TFAGaming / DiscordTS-Template

A very simple Discord bot made with TypeScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DiscordTS-Template

A very simple Discord bot made with TypeScript & discord.js version 14.

Installation

Install typescript globally:

npm i -g typescript

Install all the required dependencies:

npm i discord.js@14 dotenv

Rename the file .env.example to .env and fill all the required properties.

Warning If you are using repl.it, delete the .env file and use Secrets instead.

To compile the TypeScript files to JavaScript files & run the compiled files, use the command below:

npm run build

or, start the old compiled JavaScript files:

npm run build-start

Command example:

The class SlashCommandBuilder is from the library @discordjs/builders.

export default new Command({
    command_data: new SlashCommandBuilder()
        .toJSON(),
    options_data: {
        owner_only?: boolean
    },
    run: (client, interaction, args) => { }
});

How it works?

You can click here to understand how TypeScript compiler works.

About

A very simple Discord bot made with TypeScript.

License:GNU General Public License v3.0


Languages

Language:TypeScript 99.2%Language:Shell 0.8%