Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Reaction handler does not check for DM, causes error #1134

Open
2 tasks
bonezone2001 opened this issue Aug 10, 2020 · 0 comments
Open
2 tasks

Reaction handler does not check for DM, causes error #1134

bonezone2001 opened this issue Aug 10, 2020 · 0 comments

Comments

@bonezone2001
Copy link

bonezone2001 commented Aug 10, 2020

Describe the issue

The ReactionHandler does not check for DM messages (!message.guild) so it will attempt to "execute action on a DM channel", (remove reactions and messages).

Code or steps to reproduce

Attempt to use a ReactionHandler or RichDisplay in DM channel

Expected and actual behavior

You'd expect the handler to perform worse than usual, since reactions have to be pressed twice, but not produce any obvious error.

Instead an error is produced:
Uncaught Promise Error:
DiscordAPIError: Cannot execute action on a DM channel
at RequestHandler.execute (node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)

Further details

It's an easy fix however I'm not really familiar with git enough to commit a change 😅 simply check for a guild existing in the message object wherever actions are committed and do not perform them

  • @klasa/core version: 0.5.0
  • node.js version: 12.18.1
  • Klasa version: 0.5.0
  • I have modified core files.
  • I have tested the issue on latest master. Commit hash:
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant