Can we set both presence bubble and activity ?

Tried several ways but every time discord only show either the bubble or the activity never both of them
4 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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!
Mr¤KayJayDee
Mr¤KayJayDeeOP6mo ago
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.');
}
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 i'll try
Mr¤KayJayDee
Mr¤KayJayDeeOP6mo ago
ReadyEvent: Random activities selected: { randomMainActivity: { name: 'the community', type: 5 }, randomCustomStatus: { name: 'Custom', type: 4, state: '👀 staring into space' } }
No description
Mr¤KayJayDee
Mr¤KayJayDeeOP6mo ago
i am sure only this part is setting the presence 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,
},
};
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,
},
};
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
}
]
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 🤔 Yes, i seed the activity status of the bot if i set it only I also the the activity of other people too

Did you find this page helpful?