museofficial / muse

🎧 a self-hosted midwestern Discord music bot that doesn't suck
MIT License
886 stars 233 forks source link

Error 50007 "Cannot send messages to this user" #845

Closed nerif-tafu closed 1 year ago

nerif-tafu commented 1 year ago

I am having issues when inviting the bot with the URL generated during the start-up script. Even when inviting the bot with permissions=8 I am shown the below error.

DiscordAPIError[50007]: Cannot send messages to this user
    at SequentialHandler.runRequest (/home/hosted/muse/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:287:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at SequentialHandler.queueRequest (/home/hosted/muse/node_modules/@discordjs/rest/src/lib/handlers/SequentialHandler.ts:99:14)
    at REST.request (/home/hosted/muse/node_modules/@discordjs/rest/src/lib/REST.ts:50:22)
    at DMChannel.send (/home/hosted/muse/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:175:15)
    at Client.guild_create_default (/home/hosted/muse/src/events/guild-create.ts:43:3) {
  rawError: { message: 'Cannot send messages to this user', code: 50007 },
  code: 50007,
  status: 403,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/1049822517302399006/messages',
  requestBody: {
    files: [],
    json: {
      content: "👋 Hi! Someone (probably you) just invited me to a server you own. By default, I'm usable by all guild member in all guild channels. To change this, check out the wiki page on permissions: https://github.com/codetheweb/muse/wiki/Configuring-Bot-Permissions.",
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    }
  }
}

Runtime I'm running Muse:

Versions

codetheweb commented 1 year ago

Maybe one of these settings needs to be changed?

Screenshot 2022-12-07 at 7 04 18 PM

nerif-tafu commented 1 year ago

Sadly not, these are my settings:

image

codetheweb commented 1 year ago

Hmm, I assume you're a member of the guild you're inviting Muse to? I think that's the last scenario where this error is supposed to be thrown, not sure what else it could be.

nerif-tafu commented 1 year ago

Yeah I'm the administrator of that guild, weird stuff

codetheweb commented 1 year ago

I doubt this will fix anything but I'd try deleting Muse's local database file.

nerif-tafu commented 1 year ago

I tested the bot on both a Ubuntu 20.04 install and also a windows 10 install and both had the same issues. I'm going to use another music bot for now, and won't be doing any more troubleshooting. Feel free to close the issue if you want, but it might be worth leaving here if other people have a similar problem

codetheweb commented 1 year ago

It's also worth noting that you should still be able to use the bot, even if it can't send the invite message for some reason.