user ID from command

How should I get the user ID from command runner
11 Replies
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Awashcard0
Awashcard016mo ago
node = 12.22.10 I tried interaction.user.id and that can work pls help
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Awashcard0
Awashcard016mo ago
run: async ({ client, interaction, args }) => {
let times = interaction.options.getNumber('times')
let say = interaction.options.getString('say')
if (times > 10) {
return interaction.followUp(`Please enter number 1-10`)
} else {
if (!users.includes(interaction.user.id())) {
interaction.followUp(`Spaming (ps. You are banned from using this command for 15 min)`)
users.push(interaction.user.id())
for (var i = 0; i < times; i++) {
interaction.channel.send("Spam " + i + times + " : " + say)
}
} else {
interaction.followUp("You can't use this command right now (This is to prevent too much spaming)")
}
}

run: async ({ client, interaction, args }) => {
let times = interaction.options.getNumber('times')
let say = interaction.options.getString('say')
if (times > 10) {
return interaction.followUp(`Please enter number 1-10`)
} else {
if (!users.includes(interaction.user.id())) {
interaction.followUp(`Spaming (ps. You are banned from using this command for 15 min)`)
users.push(interaction.user.id())
for (var i = 0; i < times; i++) {
interaction.channel.send("Spam " + i + times + " : " + say)
}
} else {
interaction.followUp("You can't use this command right now (This is to prevent too much spaming)")
}
}

I need to get the user ID user so it can ban from using the command for 15 minutes so they could can prevent fully spaming
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Awashcard0
Awashcard016mo ago
ty I am a bozo I get thes error now
<rejected> DiscordAPIError: Unknown Webhook
at RequestHandler.execute (/home/runner/Pls/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/runner/Pls/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async InteractionWebhook.send (/home/runner/Pls/node_modules/discord.js/src/structures/Webhook.js:192:15) {
method: 'post',
path: '/webhooks/1081382492210208809/aW50ZXJhY3Rpb246MTA4MTM5NTYzMDU2NTQ5MDcyMDpKN0JlWjZlZHl3ZENqaEdtbWxlQ2w5dTNmWmpzNEVjTXo1S3llM2lzMmx6b3ZveEhqN09CUVpXSHdEdTFRS1RyQW9CMGhYWTF4OWoxU1dyMVd5OVI2VDV1TkJ3UENiOGhjalY5STdaY0QwaG11dW5jb3VrcE5nN0tURTl0SHNYZg?wait=true',
code: 10015,
httpStatus: 404,
requestData: { json: [Object], files: [] }
}
}
<rejected> DiscordAPIError: Unknown Webhook
at RequestHandler.execute (/home/runner/Pls/node_modules/discord.js/src/rest/RequestHandler.js:349:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/runner/Pls/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async InteractionWebhook.send (/home/runner/Pls/node_modules/discord.js/src/structures/Webhook.js:192:15) {
method: 'post',
path: '/webhooks/1081382492210208809/aW50ZXJhY3Rpb246MTA4MTM5NTYzMDU2NTQ5MDcyMDpKN0JlWjZlZHl3ZENqaEdtbWxlQ2w5dTNmWmpzNEVjTXo1S3llM2lzMmx6b3ZveEhqN09CUVpXSHdEdTFRS1RyQW9CMGhYWTF4OWoxU1dyMVd5OVI2VDV1TkJ3UENiOGhjalY5STdaY0QwaG11dW5jb3VrcE5nN0tURTl0SHNYZg?wait=true',
code: 10015,
httpStatus: 404,
requestData: { json: [Object], files: [] }
}
}
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Awashcard0
Awashcard016mo ago
no. Should I ask discord devs server?
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
Awashcard0
Awashcard016mo ago
no webhooks i did node -v
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View