Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alvesvaren/discord-ts-template
A simple template to create discord bots with typescript and slash commands
https://github.com/alvesvaren/discord-ts-template
discord discord-js hacktoberfest slash-commands template typescript
Last synced: 5 days ago
JSON representation
A simple template to create discord bots with typescript and slash commands
- Host: GitHub
- URL: https://github.com/alvesvaren/discord-ts-template
- Owner: alvesvaren
- License: mit
- Created: 2023-01-21T02:04:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-31T09:27:55.000Z (over 1 year ago)
- Last Synced: 2024-11-08T04:30:33.391Z (about 2 months ago)
- Topics: discord, discord-js, hacktoberfest, slash-commands, template, typescript
- Language: TypeScript
- Homepage:
- Size: 296 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord bot template
Template repo: https://github.com/alvesvaren/discord-ts-template
This is a simple template to create discord bots with typescript and slash
commands using discord.js. Mostly based on the official docs, but has some extra features and
structure out of the box## To use:
1. Create a bot on https://discord.com/developers
1. Create repo based on template, clone it and install packages with `yarn` (to
use another package manager, remove `yarn.lock` and update the scripts
section of `package.json` )
1. Copy `.env.example` to `.env` and populate it with your bot token
1. Run the bot using `yarn start`## To deploy:
You can deploy this however you want, but I've added a nixpacks config to make
it easy to use [railway.app](https://railway.app?referralCode=HvmU0L) (referral
link), or easily deploy it manually as a container using [nixpacks](https://nixpacks.com/docs/getting-started).## File structure:
### Main files
- index.ts - code to run the bot
- .env - contains environment variables that will be loaded when starting
- .env.example - template for .env
- types.ts - the types used for commands
- commands/ - where you put slash-commands for the bot
- echo.ts - the command echo, can be copied and changed as needed