-
-
Notifications
You must be signed in to change notification settings - Fork 280
Creating a Discord Bot
Ticket-Bot needs a Discord application, bot token, application ID, and access to your Discord server.
- Open https://discord.com/developers/applications.
- Click New Application.
- Give it a name, for example
Ticket-Bot. - Open the application.
- Copy the Application ID. This is the
clientIdinconfig/config.ts.
- Open the Bot page inside your application.
- Click Add Bot if Discord has not created one yet.
- Click Reset Token or View Token.
- Copy the token into
config/.env:
DISCORD_TOKEN=your_token_hereKeep this token private. Anyone with the token can control your bot.
The current v4 code starts the gateway with:
GatewayIntentBits.GuildsBut the Message Content intent is required if you want to use the transcript features.
Open OAuth2 -> URL Generator in the Developer Portal.
Select scopes:
botapplications.commands
For the simplest setup, select the Administrator permission.
If you do not want to use Administrator, the bot needs enough permissions to:
- View channels.
- Send messages.
- Manage channels.
- Manage roles or manage channel permission overwrites.
- Read message history.
- Use slash commands.
- Embed links.
- Attach files if your templates or future features need attachments.
- Pin messages.
The bot validates Administrator on startup and warns when it is missing because ticket creation, channel movement, permissions, panel updates, and close flows can fail without broad permissions.
Enable Developer Mode in Discord:
- Open User Settings.
- Go to Advanced.
- Enable Developer Mode.
Then right-click servers, channels, categories, roles, or users and choose Copy ID.
Common IDs used by Ticket-Bot:
- Server ID ->
guildId - Application ID ->
clientId - Staff role IDs ->
tickets.staffRoleIds - Blocked role IDs ->
tickets.blockedRoleIds - Log channel ID ->
logs.channelId - Ticket category IDs ->
ticketTypes.*.categoryId - Panel channel IDs ->
panels.*.channelId