https://github.com/acdvs/discord-bot-template
A template for basic Discord bots that respond to slash commands.
https://github.com/acdvs/discord-bot-template
Last synced: 9 months ago
JSON representation
A template for basic Discord bots that respond to slash commands.
- Host: GitHub
- URL: https://github.com/acdvs/discord-bot-template
- Owner: acdvs
- License: mit
- Created: 2024-02-08T20:47:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-08T21:05:57.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T04:21:59.789Z (over 1 year ago)
- Language: TypeScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### A template for basic Discord bots that respond to slash commands.
## Setup
1. Create a `.env` file at the root with the following contents:
```bash
BOT_TOKEN=abc
DEV_GUILD_ID=123
```
where `BOT_TOKEN` is your bot's Discord token and `DEV_GUILD_ID` is the ID of the Discord guild you'll test in locally.
2. Fill out/replace placeholder values in `src/index.ts` and the sample command in `src/commands/ping.ts`.
## Features
- On startup, the bot will automatically push all commands to the servers it's in.
- The `createBasicEmbed` function from `src/util/helpers.ts` will generate a simple colored embed for replies. Just pass in the embed body text.
- Use the `msg`, `warn`, and `error` functions from `src/util/logger.ts` for nicer console logging.