pinano-discord / Pinano-Discord-Bot

A Discord bot for the Pinano guild
MIT License
9 stars 11 forks source link

Check if subscriber is DMable before subscribing #173

Open pianiststickman opened 4 years ago

pianiststickman commented 4 years ago

Looks like the subscribe feature is failing to DM some users. Might lead to some subscribers wondering where their pings are.

0|app  | DiscordAPIError: Cannot send messages to this user
0|app  |     at /home/pinano/pinano/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
0|app  |     at /home/pinano/pinano/node_modules/snekfetch/src/index.js:215:21
0|app  |     at runMicrotasks (<anonymous>)
0|app  |     at processTicksAndRejections (internal/process/task_queues.js:94:5) {
0|app  |   name: 'DiscordAPIError',
0|app  |   message: 'Cannot send messages to this user',
0|app  |   path: '/api/v7/channels/540922047182798848/messages',
0|app  |   code: 50007,
0|app  |   method: 'POST'
0|app  | }
pianiststickman commented 4 years ago

Quick triage comment: the only thing this really causes is some (intentionally) missed DMs and a few spurious log messages. There's marginal benefit in warning the user upon subscription that we can't DM them, but only marginal.