Giter VIP home page Giter VIP logo

abdallah-alwarawreh / botwizardts Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 42 KB

BotWizardTS is a TypeScript-based Discord bot template designed to streamline the development of Discord bots. With its dynamic slash command and event system, you can effortlessly handle commands, events, and interactions in your Discord server. The template offers TypeScript support, ensuring type safety and enhanced code quality.

License: Other

TypeScript 100.00%
bot discord discord-ts discord-ts-bot template typescript

botwizardts's Introduction

Typescript Discord Bot Template

BotWizardTS is a TypeScript-based Discord bot template that provides a dynamic slash command and event system. It serves as a starting point for creating powerful and extensible Discord bots with ease.

Features

  • Dynamic slash command system: Easily create, register, and manage slash commands with a simple and intuitive syntax.
  • Event system: Handle various Discord events, such as message events, reaction events, member join events, and more, with flexibility and ease.
  • TypeScript-based: Leverage the benefits of TypeScript, including static typing, improved code organization, and enhanced tooling support.
  • Modular architecture: Organize your bot's functionality into modules for better code structure and maintainability.
  • Built-in command and event handling: Handle commands and events effortlessly with built-in utilities and decorators.
  • Customizable and extendable: Customize and extend the bot template to fit your specific needs.

Prerequisites

To use BotWizardTS, make sure you have the following prerequisites installed:

  • Node.js (version 12 or higher)
  • npm (Node Package Manager)
  • TypeScript

Getting Started

Follow the steps below to get started with BotWizardTS:

  1. Clone this repository to your local machine:
git clone https://github.com/Abdallah-Alwarawreh/BotWizardTS.git
  1. Install the project dependencies:
cd BotWizardTS
npm install
  1. Configure your bot token:

    • Rename the .env.example file to .env.
    • Open the .env file and replace YOUR_BOT_TOKEN with your Discord bot token. You can obtain a token by creating a new bot on the Discord Developer Portal.
  2. Build the TypeScript code:

npm run build
  1. Start the bot:
npm start

Creating Slash Commands

To create a new slash command, follow these steps:

  1. Create a new TypeScript file under the src/Commands/<CommandCategory>/<CommandName>.ts directory.
  2. Define your command using the provided decorators and interfaces.
  3. Implement the command's functionality.

Here's an example of a simple ping command:

import { Command } from "../../Structures/Command";

export default new Command({
    name: "ping",
    description: "reply with pong",
    run: async( {interaction} ) => {
        interaction.followUp({
            content: "Pong!",
        });
    }
});

Make sure to import the necessary decorators and interfaces from the discord.js library.

Handling Discord Events

BotWizardTS provides an event system that allows you to handle various Discord events. To create an event handler, follow these steps:

  1. Create a new TypeScript file under the src/Events/<EventName>.ts directory.
  2. Define your event handler using the provided decorators and interfaces.
  3. Implement the event handling logic.

Here's an example of a simple message event handler:

import { CommandInteractionOptionResolver } from "discord.js";
import { Event } from "../Structures/Event";
import { client } from "../app";
import { ExtendedInteraction } from "../typings/Command";

export default new Event("messageCreate", async (message) => {
    console.log(message.content);
});

Contributing

Contributions are welcome! If you want to contribute to BotWizardTS, please follow the guidelines outlined in the CONTRIBUTING.md file.

License

This project is licensed under the License.

Acknowledgments

  • Discord.js - A powerful library for interacting with the

botwizardts's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.