This is the Discord Bot used for the Chaos Raiding Central (short CRC). The idea is to have a minimal assistance bot for role calling and monitoring and maybe other Final Fantasy XIV related features.
-
Install node.js
-
Clone this repo
$ git clone https://github.com/IrealiTY/crc-bot.git
-
Download the required node modules from NPM
$ cd crc-bot $ npm install
-
Create the config.js
$ cp config_template.js config.js
-
Add the app to your discord account https://discordapp.com/developers/applications/me
-
Create a user for the app and copy the token to
config.discord.token
-
Using the Client ID found in App Details, create an invite link in the following format
https://discordapp.com/oauth2/authorize?scope=bot&client_id=CLIENT_ID
-
Start the bot
node bot.js
.iam ROLENAME
Gives you (the user) a certain role. Roles are case insensitive. Roles can be defined in config.js
.
.iamnot ROLENAME
Removes said role name from you.
Will be read from the a simple text file that can be defined in:
welcome: {
message: fs.readFileSync("welcome.sample.txt", "utf8")
}
Just modify the string to any .txt file. Markdown is supported.
You can use :NAME:
in the text file to display the name of the current user.
You can setup a channel to be wiped via a cron-job.
purge: {
"casual_content": "0 4 * * *"
┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ |
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
│ │ │ │ └───── month (1 - 12)
│ │ │ └────────── day of month (1 - 31)
│ │ └─────────────── hour (0 - 23)
│ └──────────────────── minute (0 - 59)
└──────────────────── name of the channel
}
As with any cron-job, the time is set by your server so check your time settings.
Can be configured in the config.js
. output:
Defines in which channel the log is supposed to be displayed.
monitor: {
output: "monitor",
events: [
"message", "messageDelete", "messageUpdate",
"guildMemberAdd", "guildMemberRemove"
]
}
The throttle.js
handles a time-out system via tokens. 1 Token equals to how a user can post within the given periode of time.
throttle: {
"static_lfm": { <------- Channel Name, spelling is key....
maxTokens: 1, <------- Tokens == How often a user can post
tokenInterval: 86400 <------- Timeout before a user can post again in seconds
},
},
====
Credit goes to GeekyDeaks. Drop him a donation for that ;)