TypeError on my discord bot when i run it

my bot wont run and this is what happens
43 Replies
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
const { Client, Intents } = require('discord.js');
const { bot_token } = require('./config.json');

const client = new Client({ intents: [Intents.FLAG.GUILDS] });

client.once('ready', () => {
console.log('Ready!');
});

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

const { commandName } = interaction;

if (commandName === 'ping') {
await interaction.reply('Pong!');
} else if (commandName === 'server') {
await interaction.reply('Server info.');
} else if (commandName === 'user') {
await interaction.reply('User info.');
}
});

var http = require('http');

http.createServer(function (req, res) {
res.write("Welcom, Im ALIVE!");
res.end();
}).listen(8000);



client.login(bot_token);
const { Client, Intents } = require('discord.js');
const { bot_token } = require('./config.json');

const client = new Client({ intents: [Intents.FLAG.GUILDS] });

client.once('ready', () => {
console.log('Ready!');
});

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

const { commandName } = interaction;

if (commandName === 'ping') {
await interaction.reply('Pong!');
} else if (commandName === 'server') {
await interaction.reply('Server info.');
} else if (commandName === 'user') {
await interaction.reply('User info.');
}
});

var http = require('http');

http.createServer(function (req, res) {
res.write("Welcom, Im ALIVE!");
res.end();
}).listen(8000);



client.login(bot_token);
pat
pat•3y ago
in dev version it's GatewayIntentBits.Guilds
pat
pat•3y ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
pat
pat•3y ago
Don't tag this as dev if you aren't using dev
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
pat
pat•3y ago
sorry if that came off as rude
1techy.
1techy.OP•3y ago
idk what to tag so i chose something sry i am new here
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
pat
pat•3y ago
alright, ignore my comment then and do what they said
1techy.
1techy.OP•3y ago
🤷 aight
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
uh did it work?
1techy.
1techy.OP•3y ago
1techy.
1techy.OP•3y ago
wth something is wrong it keeps running and stopping on its own
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
1techy.
1techy.OP•3y ago
1techy.
1techy.OP•3y ago
the console flashing
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
@yassaer the token is in a secrets thingy my frind told me to put it there i got a new one
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
where? srrrry i am new
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
replcae secret_name with my token or no? tbh idk replit is so confusing ok ill try IT WORKED I THINK
1techy.
1techy.OP•3y ago
its online
1techy.
1techy.OP•3y ago
thats a goodsign super sorry i am super new now to learn how to add commands. . do u all have any tutorials i can use? ok ty wait i dont have to use replit? ooo thats new
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
ngl i kinda wanna use my pc i keep it on 24/7 anyways
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.OP•3y ago
what one
1techy.
1techy.OP•3y ago
curent right i macro roblox thats why its on 24/7 i dont xD
1techy.
1techy.OP•3y ago
shall i get this studio?
1techy.
1techy.OP•3y ago
new file?
1techy.
1techy.OP•3y ago
now what
1techy.
1techy.OP•3y ago
oh sorry dude tysm! for all the help! super sorry, last question, how to make directory? NVM ILL FIND IT ON YT sry
1techy.
1techy.OP•3y ago
@tipaka i clicked something this is a directory right
1techy.
1techy.OP•3y ago
oki whats the file name i do or does it even matter? bet tysm to confirm i can just copy paste my current code from replit to here? so i cant use secrets, do i paste my token in flat out? OHHHHH
1techy.
1techy.OP•3y ago
like that? then paste it there
1techy.
1techy.OP•3y ago
dont be mad, but i just started all this today, i dont :( bet ty which one . . sorry theres ALOT do you think i can make like a multipurpose bot that can do small things? will yt help me? fr?
Want results from more Discord servers?
Add your server