Requirements
Node.js version 16.9.0 or higher
A Discord account
A code editor (e.g., Visual Studio Code)
Install Node.js: Make sure you have the latest version of Node.js installed. You can download it from the official Node.js website.
mkdir discord-bot-console
cd discord-bot-console
npm init -y
npm install discord.js
Go to the Discord Developer Portal.
Click "New Application". Enter a name for the application and click "Create".
Go to the "Bot" tab. Click "Add Bot" and confirm.
In the "Token" section, click "Copy". You will need this in your code.
In the "Privileged Gateway Intents" section, enable "Message Content Intent".
Go to the "OAuth2" tab. In the "URL Generator" section, check "bot" under "Scopes" and select the appropriate permissions under "Bot Permissions". Copy the generated URL and open it in your browser to invite the bot to your server.
Replace YOUR_BOT_TOKEN with the token of your bot that you copied earlier.
Run the bot in the terminal:
node .
ping
- The bot will respond with "Pong!".
shutdown
- The bot will shut down.
If you delet ALLOWED_CHANNEL_ID write !start on any channel you want, but u can change !start to any word.
But if you haven't deleted it copy ID channel from Discord server and paste it to: TICKET_ALLOWED_CHANNEL.
To create ticket, you must copy ID category from Discord server and pase it to: YOUR_TICKET_CATEGORY_ID.