k9
Copyright 2019 Nicole Collings
k9 is a minimalist level tracker bot for discord, used in Auri's Den. It tracks user's post frequency in a persistent database, assigning XP to posts which contributes to a total user level. The user level is used to apply custom roles to active users.
Dependencies
- NodeJS 10+
- NPM
Installation
- Clone this repository:
git clone https://github.com/Aurailus/k9
- Install node dependencies:
npm install
- Create
data/conf.json
anddata/db.json
files. - Put valid discord token and other configuration details in
data/conf.json
. - Run the bot:
npm start
Configuration
To allow the bot to start and track levels, it needs some configuration information, which goes in data/conf.json
. An example of the parameters required is below.
Example:
{
"token": "VALID_DISCORD_TOKEN",
"xp_properties": {
"level_base_cost": 15,
"level_multiplier": 0.4
}
}
In the future, role rewards will be configured within the bot. As of now to set role rewards, go in to the database file (data/db.json
) and make sure you have levelRoles
section inside your server
section.
Example:
{
"servers": [
{
"id": "your_server_id",
"levelRoles": {
"1": "role_id_for_level_1",
"5": "role_id_for_level_5",
"10": "role_id_for_level_10",
...
},
...
The key is the level which the role applies to, the value is the role id (found by right clicking the role in the Server Settings and pressing Copy ID
with developer mode enabled.)
Contributing
If you would like to contribute, please follow the code style used in the existing source files, and indent with tabs. Once you are done submit a pull request outlining what you have changed / added and why it should be implementing into the bot.
License
Copyright 2019 Nicole Collings
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.