TypeError on my discord bot when i run it

my bot wont run and this is what happens
37 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y 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);
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
idk what to tag so i chose something sry i am new here
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
🤷 aight
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
uh did it work?
1techy.
1techy.•2y ago
1techy.
1techy.•2y ago
wth something is wrong it keeps running and stopping on its own
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
1techy.
1techy.•2y ago
1techy.
1techy.•2y ago
the console flashing
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y 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•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
where? srrrry i am new
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
replcae secret_name with my token or no? tbh idk replit is so confusing ok ill try IT WORKED I THINK
1techy.
1techy.•2y ago
its online
1techy.
1techy.•2y 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•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
ngl i kinda wanna use my pc i keep it on 24/7 anyways
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1techy.
1techy.•2y ago
what one
1techy.
1techy.•2y ago
curent right i macro roblox thats why its on 24/7 i dont xD
1techy.
1techy.•2y ago
shall i get this studio?
1techy.
1techy.•2y ago
new file?
1techy.
1techy.•2y ago
now what
1techy.
1techy.•2y 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.•2y ago
@tipaka i clicked something this is a directory right
1techy.
1techy.•2y 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.•2y ago
like that? then paste it there
1techy.
1techy.•2y 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?