Share your repls and programming experiences

← Back to all posts
Discord.js Template Bot to start with
ccccssx

this is a template bot to start with discord.js. so just go to discord.js.org and work from there. the client token thing should at the bottom of all the code in the index.js file.

Voters
PapaFritaXD
sjsjs537
ccccssx
Comments
hotnewtop
akhilzebra

@ccccssx You should put the token in and environmen variable in the sidebar, otherwise other people can steal your bot token. Your code would look like this:
client.login(process.env.your-environment-var-name);

ccccssx

@akhilzebra thanks for the idea.

akhilzebra

@ccccssx no like this:

and make sure TOKEN is an enviromnemt variable that contains your bot token.