HalpyBOT Dev Update #3
Wow, another month already? Guess that means it's time for an update on the progress of HalpyBOT!
It's been a very productive month, with many of the core features of HalpyBOT 2.0 and SACM beginning to come into focus. I'd just like to ask for your attention as the flight attendants demonstrate the safety features of this HalpyBOT. In the event of a water landing... wait that's not right.
Over the last month, among other things, we've finalized our first passes on 17 new case management commands, and also gone about re-ordering the location of some sections of the code. While that latter part may seem boring, it's actually incredibly important to the longterm maintainability of the bot. We've also spent a lot of time refactoring and improving logic paths all over the bot, which will result in a faster, less memory needy program overall. With over 70 commits across 50 files in HalpyBOT, and almost 1,500 unique line changes, it's been an incredibly busy month for our Cybers.
Circular Imports Can Bite My Tail ~ Rik079
Throughout the development of HalpyBOT, we've come across a number of places where errors might occur. This might be a problem with EDSM, or with our connection to the database, or much more. For each of these, we've had to develop a series of error handlers - often by creating new Exception types and handling each of them accordingly. Historically, we've written each exception type in the file where it's most likely to occur, and this has mostly worked. However, if we need to use the exception outside of that file, we've had to import it - which gives us issues of circular imports.
Circular imports can occur when two or more modules mutually depend on each other. If this happens, the bot can't load either file, and the whole situation comes tumbling down. This has been an issue we've had to increasingly deal with, coming up with more and more creative solutions in order to avoid it. To fix it, we've finally moved all of these exceptions to their own file, which seems like we should have done from the beginning... but hey, better late than never! This has vastly simplified our code in some places, and making it less likely for these sorts of errors to occur.
The Announcer now automatically loads in a case to the case board! This means that from the moment the case ping goes out, you can refer to a case by a given ID number, and can manage so many aspects of the case! In the future, we'll be setting you up to even add responders and issue facts - all from the power of your keyboard in IRC. We've also updated our case printouts to make case details look more friendly and readable! We even help predict if a user's IRC name will be different from their CMDR Name.
A case ping with Case ID and Expected IRC User
Ultimately, the Cybers feel like it should be our goal to ensure that you never have to rely on any external services to respond to a case. While many of our new features are built with the long-awaited Dispatch Board in mind, we're also making sure you can manage every detail of a case from IRC - and that includes printing out the status of a case. To help with that, the bot has the ability to print out the details of every part of the case in DMs with you for quick reference - just ask!
The Board Listing - You can also filter by Platform or Case Type!
The Case Listing - Note how you can reference the case by ID number OR CMDR Name! How Convenient!
Case Updating and Management
Probably the single biggest feature introduced this month is the Case Management Mechanic. This allows us to track and update several key aspects of the case from the moment HalpyBOT shouts the case out onward. While several key aspects of this system were planted in the last update, much of that framework has now evolved into a fully armed and operational case board. Notably, HalpyBOT now actively takes notes on several key case actions, which will (in the future) be automatically fed into case paperwork - making your job easier!
Here's some of the new commands added this month:
A number of details about a case can be changed, which allows cases to be significantly altered without needing a duplicate case entered. These include the Client's IRC Name, System, CMDR Name, Hull %, Platform, or even if the case is Black, Blue, KingFisher, or Seal. If it's a detail about the case's facts, it can be changed. Most of them follow the same format, so we won't list them all here.
You can even rename the CMDR of a case, if they mistype their own name.
Of course, all of this will be recorded by HalpyBOT.
Did you notice we had custom notes in an earlier screenshot? Why wait for your paperwork to get started on notes! HalpyBOT will automatically take notes for you for some details, such as changing case details, but you can also manually add, view, edit, or delete note entries straight in IRC before you even load your paperwork on the website.
Made a mistake? You can even update your notes.
Updated Client Tracking
Last update, we introduced client tracking - watching for clients to join or leave the server. With the tracking of the Welcome command, we've made this more granular, with the message sent to a client on joining contingent on if the case has been Welcomed or not. It's these little things that will help clients relax and feel at home in our system.
More Granular Web Requests
Historically, if the webserver for HalpyBOT received input it couldn't understand, it assumed that something was wrong, and issued an HTTP 500 error. We've taken steps to update this, and now have specific catches to return more specific error codes if Kingfisher coordinates are malformed, or the case already exists on the case board, which will also prevent duplicate case pings in IRC. This will help make case pings more informative and help prevent duplicate cases from being submitted.
The Minor Things
Some things just don't really have anything to talk about, other than saying that they happened. However, many of these are minor bug fixes, Quality of Life enhancements, or other general updates that are worth at least mentioning. We're always hunting down and fixing bugs as we find them, and working to make the best version of HalpyBOT we possibly can.
- Updated the configuration system to specify which channels are Rescue channels.
- Added Local Case ID's to the case announcement.
- Fixed a bug where the bot's user agent was missing a ).
- Rearranged some file imports to be more in line with PEP8 Code Standards.
- Added a number of inline code annotations to help with future development.
- Simplified a few logic expressions.
- Moved a few functions around to be more logically accessable.
- Fixed a bug that could result in the edit fact command crashing.
- Fixed a bug that could break the Ping command.
- Fixed a bug that could cause the join channel command to fail silently.
- Updated the logic of the WHOIS Command.
- Added an "Unknown" Platform Fallback if something goes weird.
- Re-ordered the board isinstance checks to not fail if provided an integer.
- Converted a few EDSM classes to attrs dataclasses.
- Fixed a bug where the bot could be instructed to send a message with no content.
We're still hard at work on the next feature set. Even as I write this, our next set of issues is already in the oven, and we've got some ready to go right now that are just waiting on review! In fact, I submitted a bug fix while I was writing this very post that I found while making these examples for you. We'll hopefully be able to share more details about the next features here soon. Stay tuned! As always, you can watch our progress and review the code yourself here, if you want: https://github.com/HullSeals/HalpyBOT
See you next month!