discord: update for compatibility with new library version

This commit is contained in:
Chris Sexton 2022-03-22 09:41:11 -04:00
parent d00139259f
commit 5d4b36564f
1 changed files with 6 additions and 2 deletions

View File

@ -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
}