LakeYS / Discord-Trivia-Bot

TriviaBot: Play trivia in Discord! Powered by discord.js and OpenTDB, with 24 categories and three modes of play.
http://lakeys.net/triviabot/
Apache License 2.0
84 stars 39 forks source link

DiscordAPIError: Unknown Message #210

Closed Peterr-K closed 3 years ago

Peterr-K commented 3 years ago

Hi

this I see after time in bot's log, the bot is version from the web site.

thanks!

Successfully launched shard 0 of 0
File database '../Questions/' loaded. Parsed 201 questions in 37ms.
Shard 0 connected to 1 server.
(node:1733) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
    at /home/user/TriviaBot/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
    at /home/user/TriviaBot/node_modules/snekfetch/src/index.js:215:21
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1733) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1733) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
LakeYS commented 3 years ago

Interesting. This might be related to auto-delete-msgs, though it's hard to tell without repro or further stack traces. Any other error/warning messages or side effects when this occurs?

Peterr-K commented 3 years ago

Hi

this is the full error what I see. Settings for "auto-delete-msgs" is "true". And you are very correct, I tested it further and this is happening, when I delete manually a bot's message.

This looks like uncatched error, when message to be deleted is already deleted. So this is a bug in discord.js?

thanks

LakeYS commented 3 years ago

This should be addressed in 414a586, but some additional testing will be done soon.

LakeYS commented 3 years ago

This looks to be caught properly now -- will re-open if this is replicated again.