Go to file
Auri 266d17aadb New level algorithm, k9 level command, k9 setxp command. 2021-03-12 16:11:31 -08:00
assets New assets for K9? 2020-11-01 14:17:53 -08:00
src New level algorithm, k9 level command, k9 setxp command. 2021-03-12 16:11:31 -08:00
.gitignore New assets for K9? 2020-11-01 14:17:53 -08:00
LICENSE.md New assets for K9? 2020-11-01 14:17:53 -08:00
NOTICE.md New assets for K9? 2020-11-01 14:17:53 -08:00
README.md New assets for K9? 2020-11-01 14:17:53 -08:00
nodemon.json New level algorithm, k9 level command, k9 setxp command. 2021-03-12 16:11:31 -08:00
package-lock.json Update package.json, remove vulnerable dependencies. 2021-03-11 23:54:41 -08:00
package.json New level algorithm, k9 level command, k9 setxp command. 2021-03-12 16:11:31 -08:00
tsconfig.json WIP Big refactor, using Mongoose now, refactor Plugins & Commands. 2021-03-11 23:51:28 -08:00

README.md

k9

Codacy Rating Discord Badge GitHub Commit

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

  1. Clone this repository: git clone https://github.com/Aurailus/k9
  2. Install node dependencies: npm install
  3. Create data/conf.json and data/db.json files.
  4. Put valid discord token and other configuration details in data/conf.json.
  5. 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.