#Need help getting started
1 messages · Page 1 of 1 (latest)
import { SlashCommandBuilder } from '@discordjs/builders';
import { CommandInteraction } from 'discord.js';
export const data = new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!');
export async function execute(interaction: CommandInteraction) {
await interaction.reply({
content: 'Pong',
ephemeral: true,
});
}
import { Client, CommandInteraction } from 'discord.js';
export const name = 'interactionCreate';
export async function execute(client: Client, interaction: CommandInteraction) {
if (!interaction.isCommand()) return;
const command = client.commands.get(interaction.commandName);
if (!command) return;
try {
await command.execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({
content: 'There was an error executing this command',
ephemeral: true,
});
}
}
literally having the exact same issue-
I wish the console would give me an error or something because I can't figure out what I'm doing wrong
actually not the exact same issue but im getting an error when i run deploy-commands.js
thats strange
wdym by fails
when I run /ping
does it make the bot go offline?
it just times out and says "This interaction has failed"
nope
weird
[
{
name: 'ping',
description: 'Replies with Pong!',
options: [],
default_permission: undefined
}
]
command seems to be registered
my bad i cant help with this. im really new to this so i would have no clue
one question is this outdated? because i did everything as it said and its still crashing. i cannot read this error at all
https://discordjs.guide/creating-your-bot/creating-commands.html#server-info-command
if not then ill be on my way
PS C:\Users\benny\OneDrive\Desktop\Desktop Folders\Programming\JavascriptProjects\DiscordBots\blu-bot> node deploy-commands.js
w[50001]: Missing Access
at Z.runRequest (C:\Users\benny\OneDrive\Desktop\Desktop Folders\Programming\JavascriptProjects\DiscordBots\blu-bot\node_modules@discordjs\rest\dist\index.js:7:581)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Z.queueRequest (C:\Users\benny\OneDrive\Desktop\Desktop Folders\Programming\JavascriptProjects\DiscordBots\blu-bot\node_modules@discordjs\rest\dist\index.js:5:2989) {
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/924015755408842842/guilds/849996814979432469/commands',
requestBody: { attachments: undefined, json: [ [Object] ] }
}
w[50001]: Missing Access
at Z.runRequest (C:\Users\benny\OneDrive\Desktop\Desktop Folders\Programming\JavascriptProjects\DiscordBots\blu-bot\node_modules\@discordjs\rest\dist\index.js:7:581)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Z.queueRequest (C:\Users\benny\OneDrive\Desktop\Desktop Folders\Programming\JavascriptProjects\DiscordBots\blu-bot\node_modules\@discordjs\rest\dist\index.js:5:2989) {
rawError: { message: 'Missing Access', code: 50001 },
code: 50001,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/924015755408842842/guilds/849996814979432469/commands',
requestBody: { attachments: undefined, json: [ [Object] ] }
}```
@night cliff would you happen to know what's going wrong with my code?
i dont know
:/
ok im actually in the exact same situation now
maybe its because of the scopes??
what are yours