Skip to content

This project provides a template for creating a Discord bot using discordx and discord.js v14.

License

Notifications You must be signed in to change notification settings

Valhalla-Development/Bot-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot Template

This project provides a template for creating a Discord bot using discordx and discord.js v14.

Features (View the bottom of this page to view screenshots)

  • Bot Info: Upon startup, the bot provides a concise status report, detailing key operational metrics such as the number of users, guilds, slash commands, events, and memory usage, as well as the Node.js and discord.js versions it's running on.
  • Error Handling: This template comes with a robust error handling system. It logs errors to the console for debugging and can send detailed error messages to a specific Discord channel. These messages are neatly formatted within a Discord embed for easy readability. To enable this feature, provide the LoggingChannel variable in your .env file with the ID of the desired channel.
  • Command Logging: Similar to error handling, this template offers the ability to log command usage. It can send formatted embeds to a channel of your choice. To enable this feature, provide the CommandLogging variable in your .env file with the ID of the desired channel.
  • TSDoc Comments and Documentation: The bot template is thoroughly documented with TSDoc comments and includes explanatory comments throughout the code. These comments and documentation serve as a helpful resource to understand how different components and functionalities of the bot work.
  • Included Commands: The template comes with two built-in commands:
    • Ping Command: This command provides statistics about the latency of your bot, giving you insights into its responsiveness.
    • Help Command: The help command is a feature-rich command built from the ground up. It utilizes slash command links to generate a dynamic and interactive help menu, making it easy for users to explore and understand the available commands.

These features provide a solid foundation for building and customizing your Discord bot while ensuring good documentation and error handling for a smooth user experience.

Setup

  1. Download the source by clicking on 'Releases' -> 'Latest version' -> 'Source code (zip)' or click here.
  2. Extract the zip using an archive tool of your choice.
  3. Inside the extracted folder, you will find a file named .env.example. Rename it to .env and fill in the necessary values. If you're unsure where to find your bot token and owner ID, refer to these links: bot token | owner ID.
  4. Open a console window in the root directory of the bot and run the following commands:
$ yarn install  # Installs the required modules. Once completed, run the next command:
$ yarn build    # Builds the source.
$ yarn start    # Starts your bot. You are now ready to use your bot!

Screenshots

Screenshots related to the Features mentioned in this page.

  • Bot Info
    Bot Info
  • Error Handling
    Error Handler
  • Command Logging
    Command Logger
  • Help Command
    Help

About

This project provides a template for creating a Discord bot using discordx and discord.js v14.

Resources

License

Stars

Watchers

Forks