TinkerStorm / interaction-prototypes

A Discord interaction prototype preparing to lay the foundations of a game service.
https://discord.gg/z5DPVHNBuw
GNU General Public License v3.0
2 stars 0 forks source link

fix: Rework invite accept / decline DM to have async catch failover. #5

Closed sudojunior closed 2 years ago

sudojunior commented 2 years ago

Any attempt to send a DM message for a response can be met with a fatal error due to unhandledException if the target user has blocked the bot itself or not permitting DMs from any server / guild the bot shares with the target user.


accept component

https://github.com/TinkerStorm/interaction-prototypes/blob/232ff467bb4ad6c4a11c45c3db7bfeca2437182f/src/components/accept.ts#L46-L59

decline component

https://github.com/TinkerStorm/interaction-prototypes/blob/232ff467bb4ad6c4a11c45c3db7bfeca2437182f/src/components/decline.ts#L23-L33