Project:Discord Bot Improvements

From DisNCord Community Wiki
Revision as of 17:58, 2 January 2023 by Kraaabs (talk | contribs) (→‎TODO)
Jump to navigation Jump to search

This is a general TODO area for improvements to the bot situation on DisNCord. Contact User:Kraaabs (Krabs#0571 on Discord) with comments/concerns/suggestions!

Better Discord logging

As it stands, the wiki discussion logs (such as Lotus Notes and Taligent Shenanigans Log or SoylentNews History Log) are manually copied and pasted before being either run through a script to convert them to WikiText, or manually formatted by hand. This approach has a few drawbacks:

  1. Things are easily missed
    1. Discord is... inconsistent when copy pasting large amounts of messages. The infinite scroll implementation in the client is fairly aggressive, and it leads to messages getting booted from the selection buffer sometimes, without anyone noticing.
  2. Manual labour
    1. The process right now is mostly manual. This gets tedious when there are large logs to be converted, or more than one log at once.
    2. Logs with images (such as Lotus Notes and Taligent Shenanigans Log) need to have their images manually downloaded, uploaded to the wiki, and embedded. That's a pain.
  3. Formatting
    1. Copy pasting logs isn't perfect. There isn't enough metadata to properly automate formatting of things like link embeds.

User:Kraaabs has written (most of) a Discord bot that can record messages to a few formats, including WikiText. After some cleanup and feature additions, it should be well suited to the task.

Raconteur TODO

  1. Better document the code, and open the repository up to the public
  2. See about using user permissions for the bot, rather than any moderator permissions
  3. Flesh out retroactive logging (in addition to the proactive logging already implemented)
  4. Grab embeds for messages as well (maybe embed them in the JSON log format as base64?)
  5. Containerize it! (see below)
  6. MediaWiki companion bot to upload images/automatically create pages (it seems there are mature Python bindings for the MediaWiki API)
  7. Whatever else I forgot (I'm sure I'll add more as I go)

Modmail/Ticketing

Currently, DisNCord doesn't have any formal modmail or ticketing for moderator concerns. Specific concerns are handled by direct messaging moderators, and communicating in the #mod-discussion channel, with User:NCommander having the final say. This may not scale well as the server continues to grow, so a proper modmail or ticketing system would be beneficial. If you have other suggestions for ticketing bots, or experience using any of these, contact User:Kraaabs (Krabs#0571 on Discord) with your thoughts!

Current proposed candidates:

discord-mod-mail

Pros

  • Extremely simple codebase
  • Sirocyl has experience with it
  • Already dockerized
  • Looks easily hackable if needed

Cons

  • Uses old-style prefixed bot commands (not necessarily a con per-se)
  • No formal role-locking -- relies on channel visibility

Ticket Tool

Pros

  • Appears very robust feature-wise
  • Comes with a handy dashboard
  • Seemingly scales well

Cons

  • The free version is rate-limited (although I don't think we'll hit the limit)
  • Features such as DM support are locked behind a paywall

Tickets

Pros

  • Similar feature set to Ticket Tool
  • Allows multiple support teams
  • Similar to Ticket Tool, used on many many servers already

Cons

  • Again, some features are paywalled

Bot Infrastructure

The thing about Discord bots is that you need to host them, of course. Ideally, for ease of management, all bots would be hosted on Restless Systems infrastructure, using Docker containers.

TODO

  1. Do we need a separate VPS for bots? Or will we host on the wiki infra?
  2. Are all the bots we want to host Dockerized already? Or do we need to make our own containers?
  3. How will we manage the containers? Manually, or with something like K8s?
    1. Actually, podman could work too, and it's a bit simpler...
  4. If we want to do auto-updates (we probably do) how will we accomplish this?
    1. User:NCommander had suggested to me that we could use GitHub/GitLab actions. If we go this route, we would likely have to mirror any bots we're using in our own GitHub/GitLab project. This could pose a problem with the proprietary bots though...
      1. Although, we don't actually need to self host those. In fact, I don't think we can (duh. coffee finally kicked in I guess)
      2. Also: to get this working we'd need to set up that Git{Lab|Hub} project in the first place
  5. For consistency's sake, are we going to re-containerize everything to use the same OS inside the containers, if they aren't already? (I doubt all of the bot authors involved are using the same OS)
    1. Despite all of the bots probably being written in different languages using different API wrappers, as much consistency as possible would be nice... Although that's mostly just OCD Sarah talking
  6. Finally, what DO we want to host? Should we take this opportunity to self host things like YAGPDB or PK alongside Raconteur and any potential ticketing bot (if we go with a self hosted one)?