Forum teuk.org

Context refactor, TMDB, ChatGPT command and Partyline revival

in Mediabot · started by TeuK · 3w ago

TeuK · 3w ago

Recent changes landed in the repository

After a long collaborative development session, here is a structured summary of what has just been integrated into the repository.

Reconnection cleanup

The reconnect() function previously duplicated the full Net::Async::IRC object construction, with roughly 80 lines copied almost verbatim from the initial connection path. This was both fragile and difficult to maintain.

That duplication has now been removed and replaced with two dedicated helpers:

  • _build_irc()
    Responsible for creating the IRC object and registering it into the IO::Async loop.

  • _do_login()
    Responsible for handling the login future and centralizing the authentication flow.

As a result, the initial connection and the reconnection logic now follow the exact same code path. This removes a long-standing maintenance hazard and makes future changes significantly safer.

Context-based command migration

Three commands have now been migrated to the Mediabot::Context pattern introduced during the previous refactoring sprint:

  • tmdb
    Movie and TV series search powered by the TMDB API.

  • tmdblangset
    Per-channel TMDB language configuration, with proper permission checks for Administrator and channel-owner roles.

  • tellme
    ChatGPT prompt handling, now exposed as a public channel command in addition to the pre-existing nick-trigger syntax.

This continues the gradual move toward a more consistent command architecture, with cleaner separation of responsibilities and a more uniform execution model.

Partyline revival

The Partyline module had existed for some time, but was entirely commented out and effectively non-functional.

It has now been fully rewritten and reactivated.

The module listens on a configurable TCP port and accepts standard telnet or netcat connections. Authentication is restricted to users with Master level or above, and is validated through the existing Mediabot::Auth credential verification flow.

The currently available commands are:

  • .stat
    Displays channel join status, nick count, owner, and active chansets.

  • .say

  • .who

  • .join

  • .part

  • .nick

  • .raw (Owner only)

This restores a previously abandoned feature and turns it into a working remote control interface for the bot.

Deployment status

The bot is currently running on teuk.org.

As usual, the code is available on GitHub.

You must be logged in to reply.