Skip to content

A suite of Discord bots that may be useful for servers.

License

Notifications You must be signed in to change notification settings

blhook/BotsForDiscord

Repository files navigation

Bots for Discord (TypeScript)

General

This project contains the source code for any personal bots that I have created for Discord. This repository assumes that the user has at least a basic understanding of Discord Bots, but refer to Discord Developer Documents and Discord.js Documents if not.

This repository consists of several pieces to begin and get up and running with the bots, but the main core of the code for the unique code interacterion is in the bots folder.

Getting Started

Prequisites

Understanding the Code

The code is largely broken into three pieces:

  1. The Bots
    • This folder contains all of the different bots with their respective handling. Right now, only Slash Commands are supported.
    • Refer to the individual underlying folder for each bot for information regarding it.
    • List:
      • Hunt Request: A bot meant to help with facilitating helping users find certain items, using a simplified modal. After created, the user is able to continually manage their request.
  2. The Register
    • This will register any commands exported from commands to the Discord server.
    • This code is largely just templated from Fellipe Utaka's tutorial found here, with slight modifications to respect the basic SlashCommand interface
    • This code runs independently from the main application, and only needs to be ran when a command is added/edited/deleted, but does not need to be re-ran when the underlying functionality of that command changes.
  3. The Main Application
    • This is the code that runs the bots. While mostly uninteresting, it does contain the code to make it work with Discord harmoniously.

Running

One-time Setup

  1. Retrieve your specific Discord's Application ID, Guild (Server) ID, and Token.
  2. Paste them into a file called secrets.ts under constants as exports
    export const TOKEN = '<TOKEN>';
    export const APPLICATION_ID = '<APPLICATION_ID>';
    export const GUILD_ID = '<GUILD_ID>';
    
  3. Run the command npm install

Register Your Commands

Before your Discord server will understand your commands, it needs to be registered. Run:

  1. npm run register

Debugging and Running

  1. Run npm run dev to start the bot and connect to the specified Guild server.

License

This project is licensed under MIT. Refer to the LICENSE for more details

This repository is not created by, affiliated with or sponsored by Discord, Inc. and its subsidiaries or its affiliates.

About

A suite of Discord bots that may be useful for servers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published