andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
502 stars 71 forks source link

Filter mention recognition dose not work if the bot has a nickname #383

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug The msgFilter.ContainsBotMention function calls std.mentionString to get the string that the message will have if it contains the mention. However discord uses a different mention syntax if the user mentioned has a nickname. (<@user_id> is for without nickname, and <@!user_id> for with nickname.)

Expected behavior That msgFilter.ContainsBotMention should detect mentions of the bot regardless of it's nickname.

Desktop (please complete the following information):

Additional context Why would discord do this? It just makes no sense to me.

andersfylling commented 3 years ago

Nice catch!

ghost commented 3 years ago

Thanks! However this only fixes it for HasBotMentionPrefix, not for ContainsBotMention, could you get that one aswell?

andersfylling commented 3 years ago

there we go, I'll make a release soon.