Tools/MessageBot
Discord Bot
A discord bot is very powerful. One can program it to do anything.
- Go to https://discord.com/developers/applications to create an applicaiton and bot
- Go to Bot tab and enable the privileged Gateway Intents. This is needed for bot to read messages.
- Go to OAuth2 tab and select the bot scope. Select required permissions (choose administrator to get all permission). Copy the link and open it in a new tab. Select the server you want to add the bot to and click Authorize.
- Go to Bot tab and copy the Token. The token is used to login to the bot.
Sample Code
Python
pip install -U discord.py
JavaScript
npm i discord.js
Note that, JavaScript version requires GuildMessages
and Guilds
intents to be enabled, while Python version does not.
Use bot to clear all messages in a channel
Reference
How is this guide?