So I'm trying to make my bot's streaming to be with depression but I've tried multiple things and they don't work.
I've tried these methods:
client.user.setPresence({ game: { name: 'with depression' }, status: 'online' });
bot.user.setGame('with depression', 'https://www.twitch.tv/monstercat');
None of these seem to be working the way they should. Any help is appreciated.
This question is related to
node.js
streaming
bots
status
discord.js
.setGame
is discontinued. Use:
client.user.setActivity("Game");
To set a playing game status.
As an addition, if you were using an earlier version of discord.js, try this:
client.user.setGame("Game");
In newer versions of discord.js, this is deprecated.
setGame
has been discontinued. You must use client.user.setActivity
.
Don't forget, if you are setting a streaming status, you MUST specify a Twitch URL
An example is here:
client.user.setActivity("with depression", {
type: "STREAMING",
url: "https://www.twitch.tv/example-url"
});
Use this:
client.user.setActivity("with depression", {
type: "STREAMING",
url: "https://www.twitch.tv/monstercat"
});
Simple way to initiate the message on startup:
bot.on('ready', () => {
bot.user.setStatus('available')
bot.user.setPresence({
game: {
name: 'with depression',
type: "STREAMING",
url: "https://www.twitch.tv/monstercat"
}
});
});
You can also just declare it elsewhere after startup, to change the message as needed:
bot.user.setPresence({ game: { name: 'with depression', type: "streaming", url: "https://www.twitch.tv/monstercat"}});
Bumping this all the way from 2018, sorry not sorry. But the newer users questioning how to do this need to know that game does not work anymore for this task.
bot.user.setStatus('available')
bot.user.setPresence({
game: {
name: 'with depression',
type: "STREAMING",
url: "https://www.twitch.tv/monstercat"
}
}
does not work anymore. You will now need to do this:
bot.user.setPresence({
status: 'online',
activity: {
name: 'with depression',
type: 'STREAMING',
url: 'https://www.twitch.tv/monstercat'
}
})
This is referenced here as "game" is not a valid property of setPresence anymore. Read the PresenceData Documentation for more information about this.
client.user.setStatus('dnd', 'Made by KwinkyWolf')
And change 'dnd' to whatever status you want it to have. And then the next field 'Made by KwinkyWolf' is where you change the game. Hope this helped :)
List of status':
Not sure if they're still the same, or if there's more but hope that helped too :)
Source: Stackoverflow.com