There are other problems like this but none of them have a solution that works for me. I want to use slash commands with my discord bot I have all the scopes including application.commands but it still gives me this when I try to execute my code:
(node:1648) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
at RequestHandler.execute (C:\Users\camer\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (C:\Users\camer\node_modules\discord.js\src\rest\RequestHandler.js:39:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1648) 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: 1)
(node:1648) [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.
I was stupid I forgot to put my guild id in quotes!
Related
I found this example for creating threads in the official discord.js guide, but it doesn't work...
const thread = await message.startThread({
name: 'food-talk',
autoArchiveDuration: 60,
reason: 'Needed a separate thread for food',
});
It returns message.startThread is not a function
What is the correct function to do this?
Full Error:
(node:1727) UnhandledPromiseRejectionWarning: TypeError: msg.startThread is not a function
(node:1727) 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: 1)
(node:1727) [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.
I think your problem is already solved but here is all you need to do for people who just found this post on google.
npm i discord.js#latest
fellow devs,
I have a quasar project that I have recently (stupidly) upgraded to the latest version to test it with vue 3. unfortunately my app does not launch and I get the following
(node:7976) UnhandledPromiseRejectionWarning: TypeError: Merging undefined is not supported
index.js:63 mergeWithOptions
[StayFit]/[webpack-merge]/dist/index.js:63:19
index.js:52 merge
[StayFit]/[webpack-merge]/dist/index.js:52:35
quasar-conf-file.js:392 QuasarConfFile.compile
[StayFit]/[#quasar]/app/lib/quasar-conf-file.js:392:29
task_queues.js:95 processTicksAndRejections
internal/process/task_queues.js:95:5
quasar-dev:237 async goLive
[StayFit]/[#quasar]/app/bin/quasar-dev:237:3
(Use node --trace-warnings ... to show where the warning was created)
(node:7976) 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: 1)
(node:7976) [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.
I have tried to roll back quasar version or uninstall it and reinstall a certain version but still the same issue.
any solution there?
Hey im making a leaderboard command with discord-xp but when i run the command it gives the following error:
(node:7400) UnhandledPromiseRejectionWarning: DiscordjsError: Request to use token, but token was unavailable to the client.
at RequestHandler.execute (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\node_modules\discord.js\src\rest\RequestHandler.js:93:15)
at RequestHandler.execute (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\node_modules\discord.js\src\rest\RequestHandler.js:97:19)
at RequestHandler.push (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\node_modules\discord.js\src\rest\RequestHandler.js:39:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async UserManager.fetch (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\node_modules\discord.js\src\managers\UserManager.js:67:18)
at async Function.computeLeaderboard (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\node_modules\discord-xp\index.js:275:30)
at async callback (C:\Users\niels\Documents\VsCode Projects\Discord Bots\flat8\commands\leveling\leaderboard.js:13:29)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7400) 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:7400) [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.
my code
can anyone help me with this?
It looks like you're trying to perform an action but your client isn't logged in. Maybe you can find help here:
https://discordjs.guide/popular-topics/errors.html#request-to-use-token-but-token-was-unavailable-to-the-client
Hope I could help
ShadowLp174
[Edit] Sry, link was broken - fixed it ;)
I have made an AFK command using Change Nickname. Whenever a user above the bot's role uses this command. I get the following error(node:169)
UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/runner/MutedPinkBlogclient/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:169) 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: 1)
(node:169) [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.
(node:169) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/runner/MutedPinkBlogclient/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:169) 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)
This later terminates the bots process. This further terminates the bots process. Is there any way to stop the node process from being terminated without increasing the role of the bot.
Here is my code for that command
client.on('message', message => {
if (message.content.includes('start-afk')) {
message.member.setNickname(`AFK | ${message.author.username}`);
}
if (message.content.includes('end-afk')) {
message.member.setNickname('');
}
});
Can you help me out?
Discord won't allow users/bot accounts to change someone's nickname if their role is higher than your bot's.
All you can do is catch the error and send an error message to the channel.
message.member.setNickname("Nickname").catch(error => message.channel.send("Couldn't update your nickname."));
I recently changed the event handler dor my discord bot and I get this error.
I edited all the files so I don`t get any error but now I get this error and it does not say where the error takes place
(node:9356) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir 'C:\Users\user1\Documents\GitHub\MYSQL_TEST\utils\events'
(node:9356) 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: 1)
(node:9356) [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.```