GageM1
June 29, 2023, 12:11pm
1
Question:
I keep getting this error with my code, but can’t seem to find anything wrong with it: `file:///home/runner/ggjhbot-1/index.js:51
client.user.setActivity(${activity}, { type: ActivityType.${action} })
^
SyntaxError: missing ) after argument list`
Repl link:
https://replit.com/@GageM1/ggjhbot-1
client.user.setActivity(${activity}, { type: ActivityType.${action} })
GageM1
June 29, 2023, 12:14pm
3
This is the actual error message:
file:///home/runner/ggjhbot-1/index.js:51
client.user.setActivity(${activity}, { type: ActivityType.${action} })
^
SyntaxError: missing ) after argument list
Try
client.user.setActivity('activity', { type: `ActivityType.${action}` })
GageM1
June 29, 2023, 12:52pm
5
Yeah, but I want the activity in set activity
to be the constant activity
.
Can You Explain More Please?
Ohhh I Understand You Now
@GageM1 Try
client.user.setActivity(`${activity}`, { type: `ActivityType.${action}` })
use bracket notation :
client.user.setActivity('activity', { type: ActivityType[action] })
GageM1
June 29, 2023, 1:08pm
10
Currently, the command doesn’t change anything.
client.user.setActivity(activity, {type: `ActivityType.${action}`});
client.user.setStatus(status);
GageM1
June 29, 2023, 1:38pm
11
Now it doesn’t throw an error but doesn’t change the status. I have an ephemeral reply to show the inputs are working, and they are.
@GageM1 try this (sorry I replied to the wrong post and messed up chronology when merging the posts)
Try
if(interaction.commandName == 'status'){
// the code...
GageM1
June 29, 2023, 5:35pm
14
That’s what I already have.
GageM1
June 29, 2023, 6:03pm
16
Still no. Logs a command was sent but doesn’t change the status.
Can You Provide A Picture Of Your Console And The Command When You Try It
GageM1
June 29, 2023, 8:17pm
19
What about client.user.setStatus
? status
and [status]
don’t work.
Try
client.user.setStatus(`${status}`)