Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.user.setStatus(); kills the bot (INVALID SESSION) #5706

Closed
slugcat-dev opened this issue May 30, 2021 · 5 comments · Fixed by #5799
Closed

client.user.setStatus(); kills the bot (INVALID SESSION) #5706

slugcat-dev opened this issue May 30, 2021 · 5 comments · Fixed by #5799
Assignees

Comments

@slugcat-dev
Copy link

Please describe the problem you are having in as much detail as possible:
Whenever I use client.user.setStatus('idle'); (idle for example), the bot stops responding and goes offline after a minute. The console does not log any errors:

image

Code of the command:

case "status":
	const status = interaction.options[0].options[0].value; 

	client.user.setStatus(status);
	interaction.reply(`Status was set to **${status}**`, { ephemeral: true });
	break;

Further details:

  • discord.js version: #03256bd9
  • Node.js version: 16.2.0
  • Operating system: Artix Linux

Relevant client options:

  • gateway intents: GUILDS, GUILD_VOICE_STATES, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS
@slugcat-dev
Copy link
Author

Trycatch wouldn't work btw because .setStatus() returns a Presence-Object, not a Promise

@SpaceEEC
Copy link
Member

What's the output you are seeing when logging the debug event? client.on('debug', console.log);

@slugcat-dev
Copy link
Author

Client logged in as USER#1234
CORTƎX#6890 used command "presence"

10 seconds of nothing...
[WS => Shard 0] [INVALID SESSION] Resumable: false.

@slugcat-dev slugcat-dev changed the title client.user.setStatus(); kills the bot client.user.setStatus(); kills the bot (INVALID SESSION) May 30, 2021
@slugcat-dev
Copy link
Author

slugcat-dev commented May 30, 2021

Looks like #5584 is related to this

@slugcat-dev
Copy link
Author

setPresence({ status: 'online' }) causes the same problem

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants