Change Presence Modal

So i tried changing the Bot's Presence with an Interaction Modal But i get this Error: Unhandled promise rejection: TypeError: Cannot read properties of undefined (reading 'user')
49 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
[email protected] node -v v16.15.1 client.on('interactionCreate', async (interaction, client) => { if (interaction.isModalSubmit()) { if (interaction.customId === 'activity-modal') { const activity = interaction.fields.getTextInputValue('activity-input').then(client.user.setPresence(${activity}))
const embed = new MessageEmbed() .setTitle(Erfolg) .setDescription(Die Activity wurde zu ${activity} geändert.) return interaction.reply({ embeds: [embed] }) } } })
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
i don't really understand
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
ok i do
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
so now it says this: Cannot access 'activity' before initialization
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Guys, please stop complaining i fixed it, thanks for your help :)
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
So i don't get any Errors but the Presence isn't changing
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
It's just removing the Presence
Bene
BeneOP3y ago
.-.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
So it's like this now
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
ehh
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
method ClientUser#setPresence() Sets the full presence of the client user.
Bene
BeneOP3y ago
then how do I do it then?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
ok
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
But then it won't work
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Bene
BeneOP3y ago
Bruh wtf man
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
.-.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Bene
BeneOP3y ago
Bro that's the code
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
i did
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Bro i did it NOW
Bene
BeneOP3y ago
i mean with that bruh sorry ?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
No it's still not working
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Why can't i fix the second thing?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
But howww do i fix it?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Ok, now i know Sorry, guys i was to stupid to check it, sorry for wasting your time and thanks
Want results from more Discord servers?
Add your server