Coder Social home page Coder Social logo

rilecraft / discordbot-template-ts Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 87 KB

A bot template with command , event , button , selectmenus , slashcommands handler and error handlers. Made in Discord.JS V14

License: MIT License

TypeScript 100.00%
discord discord-bot discord-js discord-js-bot discord-js-template discord-js-typescript discord-js-v14-handler discord-js-ts discord-js-ts-template discord-js-v14-template

discordbot-template-ts's Introduction


Discord Bot Template TS

The Discord Bot Template provides a solid foundation for creating feature-rich Discord bots using Discord.js. It includes various managers for handling message commands, buttons, select menus, slash commands, context menus, and modal forms. The template offers customization options, colorful logging, and a simple code structure.

Changelog

IMPORTANT UPDATE 1.0.7

  • Fixed Windows Support and SlashCommands & ContextMenus not Registering.
  • Added dependency of simple-json-db for the cooldown system as i rage quit and can't do it with fs myself.
  • Fixed subDirectories not working for commands.
  • Latest Discord.js adaptation.
  • Following JavaScript Naming Convention.
  • Removed node-recursive-directory dependency.
  • Support for AutoCompleteInteraction added.
  • Converted from CommonJS to ESM Module.
  • Improved handling of all events, commands with lower memory usage.
  • Main file bot.ts has been shifted to src.
  • Config file has been shifted to Src.
  • Moved from Collections to Map.
  • messageCommandsAliases has been renamed to messageCommands_Aliases
  • Quick.DB has been removed and instead all cooldowns data will be now stored in CooldownDB.txt in the root directory using fs.
  • Refactored command options.
  • chalk has been replaced with tasai.
  • Extended all command options support to interactions.
  • All custom types and interfaces are exported from ./src/types.ts.
  • SlashCommands and ContextMenus has been seperated into different folders and managed differently.
  • SlashCommands have been simplified as now instead of Guilds/<GuildID>/<Files Here>, you can use guilds: ["GUILD ID"]
  • In a slashCommand you do not need to assign the type: ApplicationCommandType property as the handler by default assumes it as ChatInput.

Documentation

For detailed documentation on command options and managers, please refer to the following links:

Command Options

Managers

Features

  • Colorful and organized logging.
  • Customization options to suit your needs.
  • Supports management of message commands, buttons, select menus, slash commands, context menus, and modal forms.
  • Includes a variety of commonly used command options (not applicable to events).
  • Supports management of custom events.
  • Simple and understandable code structure.

Notes

  • Recommended Node.js version: 16 and above.
  • Global slash commands and context menus may take time to refresh as it is controlled by Discord.
  • Guild commands may take time to refresh if there are a large number of different guild commands.
  • Collections where command and event data is stored and used:
    • <Client>.messageCommands: Message commands cache
    • <Client>.messageCommands_Aliases: Message command aliases cache
    • <Client>.events: Client events cache
    • <Client>.buttonCommands: Button interactions cache
    • <Client>.selectMenus: Select menu interactions cache
    • <Client>.modalForms: Modal form interactions cache
    • <Client>.slashCommands: Slash commands cache
    • <Client>.contextMenus: ContextMenus commands cache

Installation

To get started with the Discord Bot Template, follow these steps:

  1. Clone the repository by downloading it as a ZIP file or running the command git clone https://github.com/rilecraft/discordbot-template-ts.
  2. Navigate to the template's directory and run the command npm install (make sure npm is installed).
  3. Once all the required modules are installed, open the src/config.ts file and fill in the necessary information.
  4. Run the command npm run build && npm run start to start the bot.

Contribution

Contributions to the Discord Bot Template are welcome. To contribute, please follow these guidelines:

  1. Fork the Unstable branch. Important: All changes must be made to the Unstable branch.
  2. Make your changes in your forked repository.
  3. Open a pull request to the Unstable branch, and it will be reviewed promptly.
  4. If everything checks out, the pull request will be merged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.