This is a discord bot for the ScuffedMDB website, if you are hosting this website, this bot could be for you!
- Movie Added
Channel creation under specified category
- Movie Deleted
Channel Deletion
-
Review Added
Embed added to review thread under movie channel
- Review Modified
Embed updated
- Review Deleted
Embed removed from thread
- User Added
WIP
- User Banned
WIP
WIP
First go to the developer panel on discord and create a new application, then under the Bot tab create a new bot and save the bot token for later.
To invite the bot to a server of your choice, insert your client id found under the general information tab of the discord developer panel, to the following URL and then visit it on your browser.
https://discord.com/api/oauth2/authorize?client_id=<CLIENT_ID>&permissions=8&scope=bot%20applications.commands
Select the server you want the bot in, and job done!
Download files:
git clone https://github.com/mah51/scuffedmdb-bot.git
Install dependencies:
npm install
Configuration:
config.json
{
//version of the bot
"version": "1.0.0",
//owner of the bot
"ownerID": "143699512790089729",
//prefix for commands
"prefix": "?",
//color of standard embeds
"embedColor": "#a70000",
//ID of the server the bot is operating in
"serverID": "689991856930553917",
//category that new channels will be created on movie addition
"categoryID": "875431541025693757",
// the role that a user receives on reviewing the latest movie
"reviewedRoleID": "875431637914107955",
// If this value is true, the bot will log every event in console, to a certain channel.
"logChannel": "875590238255333396"
}
Copy .env.example, rename to .env and fill in the values. .env
BOT_TOKEN=<your bot token go to developer tab on discord create new application -> bot create bot -> copy bot token>
WEB_URL=<THE WEBSITE URL eg. https://movie.michael-hall.me>
WEBHOOK_TOKEN=<This needs to be the same token as in the website repo, and acts as a password so make it secure!>
Running the bot:
npm run build
npm run start
NB: If you want to make changes to the bot fork it first and then clone it, but make sure whenever you make a change and want to run it in production you need to run npm run build
to compile the typescript to js.
Running the bot in dev mode:
If you use vscode you can use the profile in launch.json to run the bot, or nodemon .
if not.