Skip to content

Commit

Permalink
fix(popular-topics): "dm" -> "DM" (discordjs#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
Underpants-dev authored Dec 24, 2021
1 parent aead57e commit 2bb7d3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guide/popular-topics/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ You can debug these messages in different ways:
### Cannot send messages to this user.

This error throws when the bot attempts to send a DM message to a user but cannot do so. A variety of reasons causes this:
- The bot and the user do not share a guild (often, people attempt to dm the user after kicking or banning them).
- The bot and the user do not share a guild (often, people attempt to DM the user after kicking or banning them).
- The bot tries to DM another bot.
- The user has blocked the bot.
- The user has disabled dms in the privacy settings.
- The user has disabled DMs in the privacy settings.

In the case of the last two reasons, the error is not preventable, as the Discord API does not provide a way to check if you can send a user a dm until you attempt to send one. The best way to handle this error is to add a `.catch()` where you try to dm the user and either ignore the rejected Promise or do what you want because of it.

Expand Down

0 comments on commit 2bb7d3b

Please sign in to comment.