Slash command

I have been having an issue with making slash commands work for a while. I have been able to register the commands, but I can't make the application respond. Here is my index.js file. Here is interactionCreate.js file Here is one of my commands -> ping2.js Here is my current terminal log Please find the correct files using the uploaded txt attachments below after this post.
55 Replies
CanineData
CanineDataβ€’2y ago
You need to use the interactionCreate event not messageCreate Oh wait sorry
PAdventures
PAdventuresβ€’2y ago
sorry it is interactionCreate, typo in txt
d.js docs
d.js docsβ€’2y ago
To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.
PAdventures
PAdventuresβ€’2y ago
SourceBin
Slash Command
Issue with sending slash commands
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
PAdventures
PAdventuresβ€’2y ago
in which file do i do that?
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
PAdventures
PAdventuresβ€’2y ago
oh, rightπŸ€¦β€β™‚οΈ
PAdventures#1713 in #use-commands triggered an interaction.
node:events:498
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'commands')
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:8:32)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:49:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:381:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
PAdventures#1713 in #use-commands triggered an interaction.
node:events:498
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'commands')
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:8:32)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:49:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:381:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
const { InteractionType } = require('discord.js')
module.exports = {
name: 'interactionCreate',
async execute(interaction) {
console.log(`${interaction.user.tag} in #${interaction.channel.name} triggered an interaction.`);
if (!interaction.type === InteractionType.ApplicationCommand) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction.client);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
}
const { InteractionType } = require('discord.js')
module.exports = {
name: 'interactionCreate',
async execute(interaction) {
console.log(`${interaction.user.tag} in #${interaction.channel.name} triggered an interaction.`);
if (!interaction.type === InteractionType.ApplicationCommand) return;

const command = client.commands.get(interaction.commandName);

if (!command) return;

try {
await command.execute(interaction.client);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
}
Console
PAdventures#1713 in #use-commands triggered an interaction.
node:events:498
throw er; // Unhandled 'error' event
^

ReferenceError: client is not defined
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:8:25)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:49:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:381:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
PAdventures#1713 in #use-commands triggered an interaction.
node:events:498
throw er; // Unhandled 'error' event
^

ReferenceError: client is not defined
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:8:25)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:49:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
at WebSocket.emit (node:events:520:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:381:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
Mozzy
Mozzyβ€’2y ago
client is still undefined
PAdventures
PAdventuresβ€’2y ago
ReferenceError: client is not defined
ReferenceError: client is not defined
Really?
Mozzy
Mozzyβ€’2y ago
Yes And you probably want to pass the interaction to the command as well. As Qjuh, said, use interaction.client
PAdventures
PAdventuresβ€’2y ago
yes. no now there is no error message, but nothing happened Just -> The application did not respond
Mozzy
Mozzyβ€’2y ago
You need to reply to the command
PAdventures
PAdventuresβ€’2y ago
await interaction.reply('Pong!');
await interaction.reply('Pong!');
console.log(command)
const command = interaction.client.commands.get(interaction.commandName);
const command = interaction.client.commands.get(interaction.commandName);
output
undefined
undefined
command?
Mozzy
Mozzyβ€’2y ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
PAdventures
PAdventuresβ€’2y ago
my collection is called commands
client.commands = new Collection()
client.commands = new Collection()
Mozzy
Mozzyβ€’2y ago
Yes, but that collection will be empty if you haven't added anything to it
PAdventures
PAdventuresβ€’2y ago
how do i add stuff on to it
Mozzy
Mozzyβ€’2y ago
By reading the guide I sent you
PAdventures
PAdventuresβ€’2y ago
i have and most of my code is copied from that guide for command handling
Mozzy
Mozzyβ€’2y ago
then console.log the collection to see
PAdventures
PAdventuresβ€’2y ago
k return
Collection(0) [Map] {}
Collection(0) [Map] {}
Mozzy
Mozzyβ€’2y ago
So it is empty I might have missed it, but I don't see you filling the collection anywhere. Also, it's bad practice to deploy slash commands on every start
PAdventures
PAdventuresβ€’2y ago
YAYAYYAAYAYAYAYAYAYAYAYAYAYAYAY. my ping2 command works But not my others😭 how do i use the embedBuilder
d.js docs
d.js docsβ€’2y ago
Documentation suggestion for @PAdventures:class EmbedBuilder Represents a embed in a message (image/video preview, rich embed, etc.)
PAdventures
PAdventuresβ€’2y ago
so
const exampleEmbed = new EmbedBuilder()
const exampleEmbed = new EmbedBuilder()
works?
probablyraging
probablyragingβ€’2y ago
Looks good
PAdventures
PAdventuresβ€’2y ago
const { SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, Interaction } = require('discord.js');
module.exports = {
name: "help",
description: "Gets all commmands info",
aliases: ['cmdInfo', 'info'],
data: new SlashCommandBuilder()
.setName('help')
.setDescription('Gets all commands info'),
execute(client, message, args, Discord) {
const helpEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('Help')
.setDescription('Below you will find each commmand of the PA_Admin Bot.')
.addFields([
{name: 'YouTube', value: '`p!youtube` - Use this command to get a link to the PA YouTube channel.'}
])
.setFooter('Created by PAdventures.');
interaction.reply({ embeds: [helpEmbed] });
}
}
const { SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, Interaction } = require('discord.js');
module.exports = {
name: "help",
description: "Gets all commmands info",
aliases: ['cmdInfo', 'info'],
data: new SlashCommandBuilder()
.setName('help')
.setDescription('Gets all commands info'),
execute(client, message, args, Discord) {
const helpEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('Help')
.setDescription('Below you will find each commmand of the PA_Admin Bot.')
.addFields([
{name: 'YouTube', value: '`p!youtube` - Use this command to get a link to the PA YouTube channel.'}
])
.setFooter('Created by PAdventures.');
interaction.reply({ embeds: [helpEmbed] });
}
}
this doesnt work though
probablyraging
probablyragingβ€’2y ago
What's the error?
PAdventures
PAdventuresβ€’2y ago
ValidationError > s.object(T)
Expected the value to be an object, but received string instead

Received:
| 'Created by PAdventures.'

at ObjectValidator.handle (D:\PA_Admin Backup copy\node_modules\@sapphire\shapeshift\dist\index.js:1182:25)
at ObjectValidator.parse (D:\PA_Admin Backup copy\node_modules\@sapphire\shapeshift\dist\index.js:142:88)
at EmbedBuilder.setFooter (D:\PA_Admin Backup copy\node_modules\@discordjs\builders\dist\index.js:240:26)
at Object.execute (D:\PA_Admin Backup copy\Commands\help.js:18:10)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:51:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
ValidationError > s.object(T)
Expected the value to be an object, but received string instead

Received:
| 'Created by PAdventures.'

at ObjectValidator.handle (D:\PA_Admin Backup copy\node_modules\@sapphire\shapeshift\dist\index.js:1182:25)
at ObjectValidator.parse (D:\PA_Admin Backup copy\node_modules\@sapphire\shapeshift\dist\index.js:142:88)
at EmbedBuilder.setFooter (D:\PA_Admin Backup copy\node_modules\@discordjs\builders\dist\index.js:240:26)
at Object.execute (D:\PA_Admin Backup copy\Commands\help.js:18:10)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:51:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
probablyraging
probablyragingβ€’2y ago
Footer takes in an object, you're using a string
PAdventures
PAdventuresβ€’2y ago
i gtg for a few ?
probablyraging
probablyragingβ€’2y ago
You're using a string in .setFooter(), whereas you need to be using an object
PAdventures
PAdventuresβ€’2y ago
so .setFooter(Created by PAdventures)?
probablyraging
probablyragingβ€’2y ago
No, like { text: 'footer' }
PAdventures
PAdventuresβ€’2y ago
.setFooter{ text: 'Created by PAdventures'}?
probablyraging
probablyragingβ€’2y ago
The object goes inside the footer
setFooter({ text: 'footer' })
setFooter({ text: 'footer' })
PAdventures
PAdventuresβ€’2y ago
k
TypeError: Cannot read properties of undefined (reading 'reply')
at Object.execute (D:\PA_Admin Backup copy\Commands\help.js:19:21)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:51:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
TypeError: Cannot read properties of undefined (reading 'reply')
at Object.execute (D:\PA_Admin Backup copy\Commands\help.js:19:21)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:51:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:481:22)
at WebSocketShard.onMessage (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\WebSocketShard.js:321:10)
at WebSocket.onMessage (D:\PA_Admin Backup copy\node_modules\ws\lib\event-target.js:199:18)
i need to go and ill be back in like 10-20mins
Mozzy
Mozzyβ€’2y ago
Because you named it message, but then call interaction.reply(). Please learn some basic JS
PAdventures
PAdventuresβ€’2y ago
how do i fix
Mozzy
Mozzyβ€’2y ago
Rename the variable
PAdventures
PAdventuresβ€’2y ago
const { SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, Interaction } = require('discord.js');
module.exports = {
name: "help",
description: "Gets all commmands info",
aliases: ['cmdInfo', 'info'],
data: new SlashCommandBuilder()
.setName('help')
.setDescription('Gets all commands info'),
execute(client, args, Discord, interaction) {
const helpEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('Help')
.setDescription('Below you will find each commmand of the PA_Admin Bot.')
.addFields([
{name: 'YouTube', value: '`p!youtube` - Use this command to get a link to the PA YouTube channel.'}
])
.setFooter({ text: 'Created by PAdventures'});
interaction.reply({ embeds: [helpEmbed] });
}
}
const { SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, Interaction } = require('discord.js');
module.exports = {
name: "help",
description: "Gets all commmands info",
aliases: ['cmdInfo', 'info'],
data: new SlashCommandBuilder()
.setName('help')
.setDescription('Gets all commands info'),
execute(client, args, Discord, interaction) {
const helpEmbed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('Help')
.setDescription('Below you will find each commmand of the PA_Admin Bot.')
.addFields([
{name: 'YouTube', value: '`p!youtube` - Use this command to get a link to the PA YouTube channel.'}
])
.setFooter({ text: 'Created by PAdventures'});
interaction.reply({ embeds: [helpEmbed] });
}
}
Mozzy
Mozzyβ€’2y ago
I don't understand why you pass so many things to execute(), but only use one of them. You can also import all 3 imports in one line. No need to have 2 lines of require("discord.js")
PAdventures
PAdventuresβ€’2y ago
k thanks
Mozzy
Mozzyβ€’2y ago
And, in earlier code you sent, you only actually pass interaction, so your code thinks client in your help command is an interaction.
PAdventures
PAdventuresβ€’2y ago
beacuase i was using message originally
Mozzy
Mozzyβ€’2y ago
I see
PAdventures
PAdventuresβ€’2y ago
right k
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('clear')
.setDescription('Clears x number of messages')
.addIntegerOption(option => option.setName('number').setDescription('Enter an number.')),
async execute(interaction) {
const args = interaction.options.getInteger('number');
const numberClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | Please specify the number of messages you want to clear.')
const useNumberClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | Please use a number to specify the number of messages you want to clear.')
const deleteOneClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | You must delete at least one message.')
if(!args) return interaction.reply({
content: { embeds: [numberClearEmbed]},
ephemeral: true
});
if(isNaN(args)) return interaction.reply({
content: { embeds: [useNumberClearEmbed]},
ephemeral: true
});
if(args < 1) return interaction.reply({
content: { embeds: [deleteOneClearEmbed]},
ephemeral: true
});
await interaction.messages.fetch({limit: args[0]}).then(messages => {
interaction.bulkDelete(messages).then(() => {
const clearedNumberEmbed = new EmbedBuilder()
.setColor('#36ce36')
.setTitle(`βœ… Cleared ${args[0]} messages!`)
interaction.reply({
content: { embeds: [clearedNumberEmbed]},
ephemeral: true
});
});
});
}
}
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('clear')
.setDescription('Clears x number of messages')
.addIntegerOption(option => option.setName('number').setDescription('Enter an number.')),
async execute(interaction) {
const args = interaction.options.getInteger('number');
const numberClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | Please specify the number of messages you want to clear.')
const useNumberClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | Please use a number to specify the number of messages you want to clear.')
const deleteOneClearEmbed = new EmbedBuilder()
.setColor('#ce3636')
.setDescription('πŸ˜– | You must delete at least one message.')
if(!args) return interaction.reply({
content: { embeds: [numberClearEmbed]},
ephemeral: true
});
if(isNaN(args)) return interaction.reply({
content: { embeds: [useNumberClearEmbed]},
ephemeral: true
});
if(args < 1) return interaction.reply({
content: { embeds: [deleteOneClearEmbed]},
ephemeral: true
});
await interaction.messages.fetch({limit: args[0]}).then(messages => {
interaction.bulkDelete(messages).then(() => {
const clearedNumberEmbed = new EmbedBuilder()
.setColor('#36ce36')
.setTitle(`βœ… Cleared ${args[0]} messages!`)
interaction.reply({
content: { embeds: [clearedNumberEmbed]},
ephemeral: true
});
});
});
}
}
Error
RangeError [MessageContentType]: Message content must be a string.
at verifyString (D:\PA_Admin Backup copy\node_modules\discord.js\src\util\Util.js:357:39)
at MessagePayload.makeContent (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\MessagePayload.js:110:17)
at MessagePayload.resolveBody (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\MessagePayload.js:125:26)
at ChatInputCommandInteraction.reply (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:108:56)
at Object.execute (D:\PA_Admin Backup copy\Commands\clear.js:18:38)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:50:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36) {
[Symbol(code)]: 51
}
RangeError [MessageContentType]: Message content must be a string.
at verifyString (D:\PA_Admin Backup copy\node_modules\discord.js\src\util\Util.js:357:39)
at MessagePayload.makeContent (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\MessagePayload.js:110:17)
at MessagePayload.resolveBody (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\MessagePayload.js:125:26)
at ChatInputCommandInteraction.reply (D:\PA_Admin Backup copy\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:108:56)
at Object.execute (D:\PA_Admin Backup copy\Commands\clear.js:18:38)
at Object.execute (D:\PA_Admin Backup copy\Events\interactionCreate.js:12:28)
at Client.<anonymous> (D:\PA_Admin Backup copy\index.js:50:44)
at Client.emit (node:events:520:28)
at InteractionCreateAction.handle (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\actions\InteractionCreate.js:81:12)
at Object.module.exports [as INTERACTION_CREATE] (D:\PA_Admin Backup copy\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36) {
[Symbol(code)]: 51
}
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
PAdventures
PAdventuresβ€’2y ago
i dont see anything wrong oh wait nvm looking at wrong area lol
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
PAdventures
PAdventuresβ€’2y ago
when i add await an error shows -> SyntaxError: await is only valid in async functions and the top level bodies of modules
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View