TediCross / TediCross

Bot which bridges Telegram chats with Discord channels
MIT License
676 stars 282 forks source link

Bot stops working after a bit and gives "Unknown Message, code: 10008" error #430

Open MrD4rio opened 10 months ago

MrD4rio commented 10 months ago

This issue occurs when sending a message on Discord to have it relayed to Telegram. As soon as the bot is started messages are getting relayed correctly, however after a bit (in this case I've noticed a few hours later) messages do not get relayed anymore.

After restarting the bot messages from Discord are relayed correctly, but if I leave it running and try sending a new message after 1 hour or so I get the same error and the message doesn't get relayed.

Here's the error I get:

      throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
            ^

DiscordAPIError[10008]: Unknown Message
    at handleErrors (/home/ubuntu/TediCross/node_modules/@discordjs/rest/dist/index.js:687:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.runRequest (/home/ubuntu/TediCross/node_modules/@discordjs/rest/dist/index.js:1072:23)
    at async SequentialHandler.queueRequest (/home/ubuntu/TediCross/node_modules/@discordjs/rest/dist/index.js:913:14)
    at async _REST.request (/home/ubuntu/TediCross/node_modules/@discordjs/rest/dist/index.js:1218:22)
    at async GuildMessageManager.delete (/home/ubuntu/TediCross/node_modules/discord.js/src/managers/MessageManager.js:259:5)
    at async Message.delete (/home/ubuntu/TediCross/node_modules/discord.js/src/structures/Message.js:816:5) {
  requestBody: { files: undefined, json: undefined },
  rawError: { message: 'Unknown Message', code: 10008 },
  code: 10008,
  status: 404,
  method: 'DELETE',
  url: 'https://discord.com/api/v10/channels/950543982956535829/messages/1191814675608916050'
}

In my settings I have the bridge mode set to d2t, I've also tried setting it to "both" but the situation is the same, as soon as the bot is started it works fine, after a bit it stops working and gives that error.

Lulalaby commented 10 months ago

This issue occurs when sending a message on Discord to have it relayed to Telegram.

it's clearly doing a message deletion tho

MrD4rio commented 10 months ago

it's clearly doing a message deletion tho

For some reason the error appeared as soon as I sent a message in the channel

LeroyJankins commented 10 months ago

it's clearly doing a message deletion tho

same issue for me, same code same error

LeroyJankins commented 10 months ago

You should use interaction.reply(...) instead of interaction.followUp(...)

the fix if someone can apply it , because I dont know where do I edit it

Lulalaby commented 10 months ago

Interactions aren't used at all in the bots, except for the two slash commands chatinfo & threadinfo. This has literally nothing to do with normal text messages, so it won't fix anything.

LeroyJankins commented 10 months ago

Interactions aren't used at all in the bots, except for the two slash commands chatinfo & threadinfo. This has literally nothing to do with normal text messages, so it won't fix anything.

Any idea of what might cause it?

LeroyJankins commented 10 months ago

the bug is clearly happening when deleting a message in discord

Pecacheu commented 8 months ago

Having the same bug here

Mrs-Feathers commented 5 months ago

error code 10008 means "unknown message" which happens when the discrd bot can't find the message it's trying to delete. it sounds like either a problem when you first added the bot to discord and didn't calculate permissions correctly using the developer portal, or for some reason the bot saved an incorrect ID of the message and is litterally asking discord to delete a message that doesn't exist. i don't get the error, so i hope that helps confirm it might not be the bot's fault but maybe probably discord's? if i was debugging this, i might just recreate the discord "application" for the bot using the developer's portal and see if that works better.