- To use this bot, Node.js 12.0.0 or newer must be installed.
-
Download the
zipfile. -
Configure the Bot:
- Run
npm i - You will need to create a bot application in the developers space
- Replace the placeholders in
config.jsonwith your preferred settings and your token (there are already example values in there, but the token and chnanel ID are invalid, so make sure to change it).
- Run
-
Invite the Bot to your Server:
-
In your bot's application page, navigate to OAUTH2
-
In the "scopes" section, select
bot -
In the "bot permission" section, select:
ADMINISTRATOR
-
Copy and paste the generated invite link!
-
-
Get the Bot Online
- Run
node index.js - The bot is now operational ! 🎉
- Run
Whenever somebody chats in the channel specified in config.json, the channel will be locked until there is no activity spotted for the amount of time specified in config.json (I've currently set it to five minutes, but you can change it if needed).
The channel will be unlocked until the next person chats in it, and the cycle repeats. You can also see the status of the channel from the channel name at any given time. If it is unlocked, it will show a 🔓. Otherwise, it will show 🔒.
Note: Make sure the default permissions for the specified channel are as shown:
- @everyone
READ_MESSAGES: trueSEND_MESSAGES: true
- Bot user or role
READ_MESSAGES: true
