โš™๏ธConfiguring

The fun part!

Used Thread-Watcher previously?

Your old config will be automatically converted to json5 the next time you run the bot.

Let's start off by opening the bot folder. This folder contains a file called _config.json5.

Now open that config file in your favorite file editor. If you don't have one installed I recommend visual studio code (download). You should see a file that looks almost identical to the one included below.

config.json5
/*
    If you're reading this you are probably setting up your own Thread-Watcher instance.
    Firstly, welcome to the club! :D 
    If everything goes well this'll be a short and easy proccess.

    Useful stuff:
        docs: https://docs.threadwatcher.xyz
        support server: https://threadwatcher.xyz/devserver
        application dash: https://discord.com/developers/applications
        official instance (in case you give up): https://threadwatcher.xyz/invite
*/

{
   tokens: {
      /*
        It's !!EXTREMELY!! important that you do not share this token with anyone.
        you can get it from the discord application dashboard
      */
      discord: 'SUPER SECRET',
      /*
        Used to automatically upload bot stats to top.gg. You can only get this token if your instance is accepted to top.gg.
        As a top.gg mod I'll have to further add that you'll need to modify the bot a bit for it to be allowed on top.gg as
        clones are not allowed.
      */
      topgg: '',
   },
   clientID: '',
   database: {
        // database types: "sqlite", and "mysql". I recomend using sqlite as it's plug and play
      type: 'sqlite',
      options: {
        // if you are using sqlite you can skip this part unless you want to change dataLocation
         user: '',
         password: '',
         host: '',
         port: 3306,
         database: 'threadwatcher',
         // Where sqlite data resides and backups will be made
         dataLocation: './data',
      },
   },
   // Wheter or not you want your instance stats broadcasted via HTTP. You probably dont
   statsServer: {
      enabled: false,
      port: 3000,
   },
   style: {
      error: {
         colour: '#D00000',
         emoji: '<:statusurgent:960959148848214017>',
      },
      success: {
         colour: '#4C9F70',
         emoji: '<:statusgood:960960196425957447>',
      },
      info: {
         colour: '#197BBD',
         emoji: '<:statusinfo:960960247571300353>',
      },
      warning: {
         colour: '#F18F01',
         emoji: 'โš ๏ธ',
      },
   },
   // These users will be able to run owner only commands such as eval. I recomend removing "286224826170081290" and adding your discord id here.
   owners: [
      '286224826170081290',
   ],
   // The id of your support server. Owner only commands will be registered to this server
   devServer: 'devServerId',
   // an invite to your dev server. Will be displayed when commands failed etc so users know where to contact you for help
   devServerInvite: 'https://discord.gg/server',
   // A webhook where shard notifications will be sent. Ensure this webhook starts with discord.com and NOT discordapp.com as that breaks the bot
   logWebhook: '',
}

Let's start by pasting that token you got earlier into the tokens.discord field. I want to once again reiterate the importance of keeping that token secret. If you accidentally share that token anyone with access to it can log in as your bot.

  • change the id "286224826170081290" in the owners array to your discord id.

  • change the clientID "592814450084675594" to your bots discord id

  • change devServer from "devServerId" to the id of your private server which you want the owner only commands on

  • add the server invite to the devServerInvite field

Style

Thread-Watcher comes with 4 types of responses which all have their own style. You'll see these represented as "error", "success", "info", and "warning" in the config file.

You can set the colour property to any valid colour hex and the emoji to either a valid utf-8 emoji representation or a discord emoji from any server your bot is in. A discord emoji represented as text looks something like <:statusinfo:960960247571300353>

Database

Right now there's 2 supported databases that work with Thread-Watcher. Those 2 are mysql and sqlite3. If you anticipate that the guild count of your instance will be small I recommend you use the sqlite3 database as it is far easier.

Using sqlite

  1. set database.type to DataBases.sqlite

  2. You're done! ๐ŸŽ‰

Using mysql

  1. create a database called threadwatcher

  2. create a new user with read and write access to that database (or use an existing one)

  3. change database.user to the username of the database user

  4. change database.password to the password of the database user

  5. change database.host to your database ip. (127.0.0.1 if hosted on the same computer as the bot)

  6. change database.port to the port of your database. For mysql this is normally 3306

statsServer

statsServer is used to make your bots stats available over the interwebz. Unless you are also hosting a website for your instance this is likely not of interest to you. You can disable it by setting statsServer.enabled to false

Last updated