Attempting to fetch users custom status!

i have some code how ever it errors out!
10 Replies
d.js toolkit
d.js toolkit11mo 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! - Marked as resolved by OP
snowyv4
snowyv4OP11mo ago
module.exports = {
cooldown: 4,
data: new SlashCommandBuilder()
.setName("checkstatus")
.setDescription("will see if your repping our status!"),
async execute(interaction, bot) {
const SendEmbed = new EmbedBuilder()
.setColor(ee.color)
.setTitle('Interaction successful!')
.setDescription(`your status is`)
.setAuthor({ name: 'Cosmic Bot', iconURL: ee.CosmicIMG})
.setFooter({ text: 'Cosmic Shop', iconURL: ee.CosmicIMG})
const mem = interaction.member
console.log(mem.presence.activities.type(4))
}
}
module.exports = {
cooldown: 4,
data: new SlashCommandBuilder()
.setName("checkstatus")
.setDescription("will see if your repping our status!"),
async execute(interaction, bot) {
const SendEmbed = new EmbedBuilder()
.setColor(ee.color)
.setTitle('Interaction successful!')
.setDescription(`your status is`)
.setAuthor({ name: 'Cosmic Bot', iconURL: ee.CosmicIMG})
.setFooter({ text: 'Cosmic Shop', iconURL: ee.CosmicIMG})
const mem = interaction.member
console.log(mem.presence.activities.type(4))
}
}
TypeError: mem.presence.activities.type is not a function
TypeError: mem.presence.activities.type is not a function
Danial
Danial11mo ago
activities is an array
snowyv4
snowyv4OP11mo ago
oh so i have to find the activity with the name "Custom Status" ??
Danial
Danial11mo ago
You can use the type as you were, but for every activity, not the array of activities itself
snowyv4
snowyv4OP11mo ago
how would i go about doing that? tried:
console.log(mem.presence.activities.Activity.type(4))
console.log(mem.presence.activities.Activity.type(4))
Danial
Danial11mo ago
It's an array, so you index into it, and then access type, which is a property This is basic JavaScript
snowyv4
snowyv4OP11mo ago
ah okay i see i don't understand?? why is this returning a number?
console.log(mem.presence.activities.indexOf(['Activity']))
console.log(mem.presence.activities.indexOf(['Activity']))
Danial
Danial11mo ago
Because you're using indexOf, which returns an index? Do you know JavaScript?
snowyv4
snowyv4OP11mo ago
alr bro ill just chat gpt it
Want results from more Discord servers?
Add your server