Jake
DIAdiscord.js - Imagine an app
•Created by Jake on 8/17/2024 in #djs-questions
Setting emojis in a select menu
select.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel(`${result.label}`)
.setDescription('test')
.setEmoji(/* What do I put here? */)
.setDescription('x')
.setValue(result.label)
);
select.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel(`${result.label}`)
.setDescription('test')
.setEmoji(/* What do I put here? */)
.setDescription('x')
.setValue(result.label)
);
setEmoji
? Every time I try and run the bot, it crashes with {
code: "BUTTON_COMPONENT_INVALID_EMOJI",
message: "Invalid emoji",
}
{
code: "BUTTON_COMPONENT_INVALID_EMOJI",
message: "Invalid emoji",
}
"thumbups"
- { name: "thumbups"}
- "<:thumbups:>"
- interaction.client.emojis.cache.get("thumbsup")
58 replies
DIAdiscord.js - Imagine an app
•Created by Jake on 8/1/2024 in #djs-questions
Bot refuses to send messages because of missing access.
Stack trace:
DiscordAPIError[50001]: Missing Access
at handleErrors (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:1133:23)
at async SequentialHandler.queueRequest (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:963:14)
at async _REST.request (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async TextChannel.send (/home/jake/finnbot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:177:15)
at async publishRules (/home/jake/finnbot/src/commands/admin/rule.js:113:2)
at async Object.execute (/home/jake/finnbot/src/commands/admin/rule.js:220:5)
at async Object.execute (/home/jake/finnbot/src/events/interactionCreate.js:47:5) {
requestBody: {
files: [ [Object] ],
json: {
content: undefined,
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: [Array],
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
},
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1267120761483821057/messages'
}
DiscordAPIError[50001]: Missing Access
at handleErrors (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:1133:23)
at async SequentialHandler.queueRequest (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:963:14)
at async _REST.request (/home/jake/finnbot/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async TextChannel.send (/home/jake/finnbot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:177:15)
at async publishRules (/home/jake/finnbot/src/commands/admin/rule.js:113:2)
at async Object.execute (/home/jake/finnbot/src/commands/admin/rule.js:220:5)
at async Object.execute (/home/jake/finnbot/src/events/interactionCreate.js:47:5) {
requestBody: {
files: [ [Object] ],
json: {
content: undefined,
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: [Array],
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
},
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1267120761483821057/messages'
}
17 replies