#How to make bot message delete?

44 messages · Page 1 of 1 (latest)

echo sundialBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

nova kindle
#

you do exactly that, but ensure message is the bots message

#

if you're using <TextChannel>.send() or similar, it returns a promise with the sent message

#

resolve it and call .delete() on it

flint viper
#

message.delete deletes player message that fired command

nova kindle
#

message.delete() deletes the message in the message variable

#

seems like in your case it is the "players" message

flint viper
#

this is message that bot sends and i want to make it delete after 2 seconds message.channel.send(`${message.member} Have been successfully verified`)

nova kindle
#

also, how come you're using v13 and v14?

flint viper
#

i use v12

#

12.22.10

nova kindle
#

im afraid that version does not exist

flint viper
#

it does

nova kindle
#

so you're using 12.5.3

flint viper
#

12..5.3

#

Oh my bad

nova kindle
#

which is not supported

flint viper
#

i tried other versions but the other versiosn doesnt support express (24/7 thing)

nova kindle
#

that has nothing to do with discord.js

flint viper
#

then why it does work only in 12.5.3 and when i do 13 or 14 it does not work

nova kindle
#

that's incredibly vague

#

either way, you should update to v13, and then to v14, or both at the same time

flint viper
#

so 12.5.3 cant delete his self message?

nova kindle
#

doesn't matter, as it is not supported

flint viper
#

how can i update it?

#

so the code stays

urban lance
#

Read the update docs

wintry stag
#

Also you need to update node, v12 is really old. You need v16.9 for djs iirc

nova kindle
#

you need 16.9 for discord.js v14

flint viper
#

alr

flint viper
nova kindle
#

is it still the same issue?

flint viper
#

No

#

I update everything

#

but i got this error

#

@nova kindle

nova kindle
#

looks like a warning to me

#

nothing to worry about

flint viper
#

but the bot doesnt start then

#

Do i have my code good?

#
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isChatInputCommand()) return;

  if (interaction.commandName === 'ping') {
    await interaction.reply('Pong!');
  }
});

client.login('HIDDEN');
nova kindle
#

you should create a new thread, or use #djs-help-v14