https://github.com/hoonsubin/discord-bot-starter
simple discord bot starter project using Discord.js and TypeScript
https://github.com/hoonsubin/discord-bot-starter
automation bot discord webhook
Last synced: 2 months ago
JSON representation
simple discord bot starter project using Discord.js and TypeScript
- Host: GitHub
- URL: https://github.com/hoonsubin/discord-bot-starter
- Owner: hoonsubin
- License: mit
- Created: 2020-12-28T03:47:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T18:24:35.000Z (over 3 years ago)
- Last Synced: 2025-10-31T11:37:28.240Z (8 months ago)
- Topics: automation, bot, discord, webhook
- Language: TypeScript
- Homepage:
- Size: 921 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Bot Starter Project
## Introduction
This is a Discord bot starter project made with [Discord.js](https://discord.js.org/) and TypeScript.
This template project comes with a simple ping-pong slash command for a predefined guild (server).
## Usage
### Creating a Discord Application
To create an application that can be registered to a Discord server, you must create a Discord app via the [Discord Developer Portal](https://discord.com/developers/applications).
Once you created an app, you can access the client ID from the `General Information` setting and the bot token from the `Bot` setting (see image below).


### Configuration
To start the bot server, you must provide the application credentials environmental variables.
You can do this by creating a `.env` file with the following variables.
```env
# Bot user app token
DISCORD_APP_TOKEN=
# Bot user client ID
DISCORD_APP_CLIENT_ID=
# Server ID for the bot to be installed
DISCORD_GUILD_ID=
```
The `DISCORD_GUILD_ID` refers to the Discord server ID (or guild ID) that the bot will listen to.
You can configure the OAuth2 redirect URL to read and store the guild ID from a remote database when the user add the application to their server for public distribution.
`src/config/appConfig.json` contains the bot permission, scope, and slash commands.
The values must reflect the ones in the Discord Developer Portal app settings.
### Scripts
```bash
# install all the dependencies
yarn
# starts the server app in node.js environment
yarn start
# or you can use `yarn serve`
# starts a development server with ts-node
yarn dev
# transpile the project for production
yarn build
```
### Quick Start
After running `yarn dev`, open to install the application to your Discord server.
Go to a Discord channel that the bot has access to and type `/ping`.

## Further Readings
For more information, please refer to the official Discord developer portal or the Discord.js documentation.
-
-
-