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

Bug: RichDisplays in DMs Destroy Logs #147

Closed
1 of 2 tasks
Skillz4Killz opened this issue Dec 27, 2017 · 5 comments
Closed
1 of 2 tasks

Bug: RichDisplays in DMs Destroy Logs #147

Skillz4Killz opened this issue Dec 27, 2017 · 5 comments
Labels
Status: Invalid Issues that will not be fixed or PRs that will not merge, e.g. due to backwards compatibility.

Comments

@Skillz4Killz
Copy link
Contributor

Skillz4Killz commented Dec 27, 2017

Describe the issue

Having a RichDisplay sent in a DM will cause havoc on your logs. The commands work perfectly. The rich display works perfectly. The pages change perfectly. It does everything that it should do but it keeps sending this error to your log for every reaction that clicked. So if a user clicks 2-3 times and you have thousands of users on a popular command it destroys logs.

There should be a way to catch/ignore this error somehow because as I said the command works perfectly. The users have no issues. But the developer logs are insanely spammed.

Uncaught Promise Error: 
DiscordAPIError: Cannot execute action on a DM channel
 at item.request.gen.end (node_modules/discord.js/src/rest/handlers/RequestHandler.js:79:65)
at then (node_modules/snekfetch/src/index.js:218:21)
 at <anonymous>
 at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Code or steps to reproduce

1) Create a rich display command to run in a DM
2) Use reactions
3) Check logs

Expected an actual behaviour

Either a workaround or some sort of method to avoid this log is necessary. The only issue here is with the error log and not the RichDisplay or command. All i really need is a way to ignore this error from my console.

Further details

  • discord.js version: latest
  • node.js version: 9+
  • Klasa version: latest
  • I have modified core files.
  • I have tested the issue on latest master. Commit hash:
@kyranet
Copy link
Contributor

kyranet commented Dec 27, 2017

I strongly believe that issue is caused exactly in this line:

collected.first().delete();

And here aswell:

if (this.ended) return this.message.clearReactions();

This issue could be solved by checking permissions. I'll try to add a getter that checks the permissions to solve this issue.

@kyranet kyranet added the Bug: Confirmed Issues that report confirmed bugs. label Dec 27, 2017
@kyranet kyranet added Bug: Pending Response Issues that report bugs and are pending of a response from the author. Bug: Fixed Issues that report bugs and have been fixed. and removed Bug: Pending Response Issues that report bugs and are pending of a response from the author. labels Dec 27, 2017
@bdistin
Copy link
Contributor

bdistin commented Dec 29, 2017

This is why #149 exists.

@bdistin bdistin closed this as completed Dec 29, 2017
@bdistin bdistin added Status: Invalid Issues that will not be fixed or PRs that will not merge, e.g. due to backwards compatibility. and removed Bug: Confirmed Issues that report confirmed bugs. Bug: Fixed Issues that report bugs and have been fixed. labels Dec 29, 2017
@kyranet
Copy link
Contributor

kyranet commented Dec 29, 2017

Whilst #149 is probably a Discord Client bug (ratelimits, connection issues...), this is not, this issue is caused by the lack of MANAGE_MESSAGES permission in DM channels. Locking such feature to guilds is a bad idea, and I also wanted to use RichDisplay in DMs for latter projects.

@bdistin
Copy link
Contributor

bdistin commented Dec 29, 2017

149 is not because of a discord client bug; it only effects the menu when a reaction is added, which is why manage messages is Required

@kyranet
Copy link
Contributor

kyranet commented Dec 29, 2017

Can you elaborate that response, please?

I could reproduce 149 only when I had network hiccups or was reacting too fast, and I was able to reproduce this even in guilds with full permissions, not only in DMs nor without permissions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Invalid Issues that will not be fixed or PRs that will not merge, e.g. due to backwards compatibility.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants