How to make it auto stop

const { Client, GatewayIntentBits } = require('discord.js');

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

const BOT_TOKEN = 'almostleakedthetoken’;

const commands = [
{
name: 'review',
description: 'Fetch review information',
options: [
{
name: 'reviewid',
description: 'ID of the review to fetch',
type: 3,
required: true,
},
],
},
{
name: 'userinfo',
description: 'Fetch user information',
options: [
{
name: 'userid',
description: 'ID of the user to fetch',
type: 3,
required: true,
},
],
},
];

(async () => {
await client.login(BOT_TOKEN);

const application = await client.application.fetch();
await application.commands.set(commands);

console.log('Slash commands deployed successfully.');
})();
const { Client, GatewayIntentBits } = require('discord.js');

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

const BOT_TOKEN = 'almostleakedthetoken’;

const commands = [
{
name: 'review',
description: 'Fetch review information',
options: [
{
name: 'reviewid',
description: 'ID of the review to fetch',
type: 3,
required: true,
},
],
},
{
name: 'userinfo',
description: 'Fetch user information',
options: [
{
name: 'userid',
description: 'ID of the user to fetch',
type: 3,
required: true,
},
],
},
];

(async () => {
await client.login(BOT_TOKEN);

const application = await client.application.fetch();
await application.commands.set(commands);

console.log('Slash commands deployed successfully.');
})();
14 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna16mo ago
As you were told, not djs related, #other-js-ts
gamer50082
gamer50082OP16mo ago
it is it uses discord.js not ptero issue
treble/luna
treble/luna16mo ago
Just because it uses djs doesnt mean its djs relatzs
gamer50082
gamer50082OP16mo ago
its not ptero
treble/luna
treble/luna16mo ago
Do you get any errors?
gamer50082
gamer50082OP16mo ago
The script doesnt stop nope
treble/luna
treble/luna16mo ago
And what output do you get?
gamer50082
gamer50082OP16mo ago
is there a way to kill it ?
treble/luna
treble/luna16mo ago
Also use rest
gamer50082
gamer50082OP16mo ago
Slash commands deployed successfully.
treble/luna
treble/luna16mo ago
Yeah well You login to yor client Would be weird if it stopped Thats why i said to use rest
gamer50082
gamer50082OP16mo ago
oh ah yes rest to edit the commands ok
d.js docs
d.js docs16mo ago
guide Creating Your Bot: Registering slash commands read more
Want results from more Discord servers?
Add your server