Typescript template for a discord bot using discord.js.
> git clone https://github.com/formal-pancake/Discord-Typescript-Template.git
> npm install
> npm install -g typescript
First of all, you will need to create a .env
file in the root directory:
TOKEN = "YOUR_TOKEN"
GUILD = "YOUR_GUILD_ID"
ADMIN_ID = "YOUR_USER_ID"
Setting up a GUILD variable is only needed during development.
You can find you bot'sTOKEN
on the Discord dev Portal
Once you completed all the steps above, all you have to do is start the app:
> npm run start
To register all slash commands located in ./src/commands
, send !setup
in a server where you added the bot.
If a guild id is provided in the
.env
, commands will register for that guild specifically. Remove it to register them application wide.