#Can we set both presence bubble and activity ?

19 messages ยท Page 1 of 1 (latest)

severe tundra
#

Tried several ways but every time discord only show either the bubble or the activity never both of them

idle ibexBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • 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!
drowsy kraken
#

yes. activities are an array

severe tundra
#
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

drowsy kraken
#

don't use setActivity if you want to have more than one. setPresence like that should work though Thonk

severe tundra
#

i'll try

drowsy kraken
#

make sure you have no other setActivity, setPresence or setStatus calls anywhere

severe tundra
#

ReadyEvent: Random activities selected: {
randomMainActivity: { name: 'the community', type: 5 },
randomCustomStatus: { name: 'Custom', type: 4, state: '๐Ÿ‘€ staring into space' }
}

severe tundra
drowsy kraken
#

no presence: {..} in your client options?

severe tundra
#

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,
    },
  };
drowsy kraken
#

also not visible on full profile, not just the small card?

#

code-wise it all looks good to me

severe tundra
#

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 ๐Ÿค”

drowsy kraken
severe tundra
#

Yes, i seed the activity status of the bot if i set it only