#Need help getting started

1 messages · Page 1 of 1 (latest)

night pollen
#

My bot is starting up but when I try to run the ping command it fails. I'm not getting any errors in the console. I could do with some help.

#
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,
    });
  }
}
mossy cliff
#

literally having the exact same issue-

night pollen
#

I wish the console would give me an error or something because I can't figure out what I'm doing wrong

mossy cliff
#

actually not the exact same issue but im getting an error when i run deploy-commands.js

#

thats strange

#

wdym by fails

night pollen
#

when I run /ping

mossy cliff
#

does it make the bot go offline?

night pollen
#

it just times out and says "This interaction has failed"

night pollen
mossy cliff
#

weird

night pollen
#
[
  {
    name: 'ping',
    description: 'Replies with Pong!',
    options: [],
    default_permission: undefined
  }
]
#

command seems to be registered

mossy cliff
#

my bad i cant help with this. im really new to this so i would have no clue

#

if not then ill be on my way

night pollen
#

what error are you getting

#

no it's not outdated

mossy cliff
#

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
mossy cliff
#

oh my lord

#

thank you 😅

night pollen
#

@night cliff would you happen to know what's going wrong with my code?

night cliff
#

i dont know

night pollen
#

:/

mossy cliff
#

ok im actually in the exact same situation now

#

maybe its because of the scopes??

night pollen
#

idk

#

I'm new to this.

#

I setup my scopes like the guide suggested

mossy cliff