#Can we set both presence bubble and activity ?
19 messages ยท Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
yes. activities are an array
logger.debug('ReadyEvent: Setting bot presence...');
const funnyActivities = [
{ name: 'Custom', type: ActivityType.Custom, state: '๐โโ๏ธ surfing on the code' },
{ name: 'Custom', type: ActivityType.Custom, state: '๐ staring into space' },
{ name: 'Custom', type: ActivityType.Custom, state: '๐ค debugging life' },
{ name: 'Custom', type: ActivityType.Custom, state: '๐ฑ meowing along' },
];
const botActivities = [
{
name: '/help for commands',
type: ActivityType.Listening,
},
{
name: 'Xink0\'s code',
type: ActivityType.Watching,
},
{
name: 'the community',
type: ActivityType.Competing,
},
];
const randomCustomStatus = funnyActivities[Math.floor(Math.random() * funnyActivities.length)];
const randomMainActivity = botActivities[Math.floor(Math.random() * botActivities.length)];
console.log('ReadyEvent: Random activities selected:', {
randomMainActivity,
randomCustomStatus,
});
if (randomMainActivity && randomCustomStatus) {
discordClient.user.setPresence({
activities: [
randomMainActivity,
randomCustomStatus
],
status: 'online',
});
logger.info('โ
Successfully set combined bot presence.');
} else {
logger.warn('โ ๏ธ Could not set combined presence because one of the activities was null.');
}
i also tried setActivity and setPresence separately
don't use setActivity if you want to have more than one. setPresence like that should work though 
i'll try
make sure you have no other setActivity, setPresence or setStatus calls anywhere
ReadyEvent: Random activities selected: {
randomMainActivity: { name: 'the community', type: 5 },
randomCustomStatus: { name: 'Custom', type: 4, state: '๐ staring into space' }
}
i am sure only this part is setting the presence
no presence: {..} in your client options?
nope
const clientOptions: ClientOptions = {
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildExpressions,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.AutoModerationConfiguration,
GatewayIntentBits.AutoModerationExecution,
GatewayIntentBits.GuildMessagePolls,
GatewayIntentBits.DirectMessagePolls,
],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
Partials.Reaction,
Partials.GuildScheduledEvent,
Partials.ThreadMember,
],
allowedMentions: {
parse: ['users', 'roles'],
repliedUser: false,
},
rest: {
timeout: 30000,
retries: 3,
},
};
also not visible on full profile, not just the small card?
code-wise it all looks good to me
yes never visible, also it seems like it is never taking the activity
tried refreshing my client but still nothing
console.log(discordClient.user.presence?.activities);
returns this
12:14:15 [info]: โ
Successfully set combined bot presence.
[
Activity {
name: '/help for commands',
type: 2,
url: null,
details: null,
state: null,
applicationId: null,
timestamps: null,
party: null,
syncId: null,
assets: null,
flags: ActivityFlagsBitField { bitfield: 0 },
emoji: null,
buttons: [],
createdTimestamp: undefined
},
Activity {
name: 'Custom',
type: 4,
url: null,
details: null,
state: '๐ staring into space',
applicationId: null,
timestamps: null,
party: null,
syncId: null,
assets: null,
flags: ActivityFlagsBitField { bitfield: 0 },
emoji: null,
buttons: [],
createdTimestamp: undefined
}
]
Then my code works ๐ค
Are you sure it's not an issue with your discord app, not your code? Do you see activities of other users having a custom status?
Yes, i seed the activity status of the bot if i set it only