From 5d4b36564f83ffae825a3d562316786cc7e6baba Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Tue, 22 Mar 2022 09:41:11 -0400 Subject: [PATCH] discord: update for compatibility with new library version --- connectors/discord/discord.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/connectors/discord/discord.go b/connectors/discord/discord.go index 6e4828c..0187fe4 100644 --- a/connectors/discord/discord.go +++ b/connectors/discord/discord.go @@ -247,7 +247,7 @@ func (d *Discord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreate isCmd, text := bot.IsCmd(d.config, m.Content) - tStamp, _ := m.Timestamp.Parse() + tStamp := m.Timestamp msg := msg.Message{ ID: m.ID, @@ -276,7 +276,11 @@ func (d *Discord) URLFormat(title, url string) string { // GetChannelName returns the channel ID for a human-friendly name (if possible) func (d *Discord) GetChannelID(name string) string { - chs, err := d.client.UserChannels() + guildID := d.config.Get("discord.guildid", "") + if guildID == "" { + return name + } + chs, err := d.client.GuildChannels(guildID) if err != nil { return name }