Giter Site home page Giter Site logo

peakh / sample-discordjs-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joeyk710/sample-discordjs-bot

0.0 0.0 0.0 32 KB

This is a sample discord bot made with TypeScript, using discord.js. Uses examples from the discord.js guide - https://discordjs.guide/ with a handler that supports command categories.

License: GNU General Public License v3.0

Shell 1.18% TypeScript 98.82%

sample-discordjs-bot's Introduction

About

This is a sample Discord bot written in TypeScript. It uses discord.js with examples used from the discord.js guide.

Features include:

  • Command & event handler
  • A sample slash command & context menu command
  • Command cooldowns
  • Command permission checks
  • Guild-only option (commands can be used only in guilds)

Getting Started ๐ŸŽ‰

  1. Clone the repository
  2. Open the .env file and fill in the required values shown below
TOKEN= # Your bot token

GUILD_ID= # Replace with your guild ID
# <- add infront of GUILD_ID if you want to register commands globally

CLIENT_ID= # Replace with your client id
  1. Rename the .env.example file to .env
  2. Installing dependencies
npm install
  1. Deploying Commands
npm run deploy

If you want to deploy the commands to a single server, make sure you put a GUILD_ID in the .env file. Then run npm run deploy in your terminal.

If you want to deploy the commands to all servers, don't put a GUILD_ID in the .env file.

Note: Only run this command if you add commands or edit the command options such as the name, description, etc.

  1. Starting the bot
npm run start

Commands ๐Ÿค–

Name Description
/ping Responds with "Pong!"
Echo Echoes the message selected in the channel the command was sent in

Note: These are just sample commands. You can add more commands by creating new folders in the src/commands directory.

Follow the discord.js guide on how to create commands and look at the discord.js docs for more information.

TypeScript knowledge is required if you plan on making changes to this project.

Issues ๐Ÿ’ญ

If you have any problems, please don't hesitate to open an issue here.

Contributing ๐Ÿ™Œ

Contributions are welcome! Please don't hesitate to open a pull request here.

Any changes that you make be tested and functional before opening a pull request. Any pull requests that are not tested and functional will be closed.

License ๐Ÿชช

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details

sample-discordjs-bot's People

Contributors

joeyk710 avatar peakh 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.