Skip to content

f1ndev/discord-typescript-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript Discord Bot

This is a Discord bot using Discord.js and Typescript. It handles setting up the bot's connection to the Discord API, importing and executing event and action files, and registering slash commands and other discord functions.

Dependencies:

  • discord.js
  • mongoose

devDependencies :

  • dotenv
  • ts-node-dev
  • tsconfig-paths
  • typescript

Usage:

1 - Clone the repository 2 - Install dependencies

npm install

3 - Create a .env file and set environment variables.

4 - Run the script in development mode

npm run dev

Environment Variables:

NODE_ENV=
DISCORD_CLIENT_ID=
DISCORD_TOKEN=

Utilities:

validateInstance: Checks if a token is provided. registerCommands: Registers commands with the Discord API. logger: Logs messages with timestamps and icons. getRandomNumber: Generates a random number. setGuildOption: Not implemented. nodejsErrorListener: Listens to and logs Node.js errors.

Types:

  • Action: Defines the structure of an action (command or event).
  • GuildOption: Defines the structure of guild options.

About

A Discord.js bot client using Typescript & NodeJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published