realNikkii / NecoBot

Just a funny little Discord bot
GNU General Public License v3.0
2 stars 1 forks source link

Bot crashes if user has disabled DMs from the bot's server #8

Closed Pyraqq closed 2 years ago

Pyraqq commented 2 years ago

obraz Just like in the title, if the option in the image is disabled the bot crashes with an error: DiscordAPIError: Cannot send messages to this user I guess an easy fix would be to check for this error before sending the message and responding to the user with something like: "This user has disabled direct messages on this server!"

Pyraqq commented 2 years ago

https://github.com/Succling/NecoBot/commit/2237334f108bae82ab3bcf759a7f13d187e4e2e0 technically fixes this, but it is not ideal. Not closing until a proper fix is going to be created.

Pyraqq commented 2 years ago

https://github.com/Succling/NecoBot/commit/e069a7693a0b2dbeb64b8e6af6e2ea621a7b9633 fixes it once and for all, closing.