allow to change topic when needed

Bug #577694 reported by m4v
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ClassBot
Confirmed
Undecided
Unassigned

Bug Description

don't hardcode topic format within the bot code, there might be cases where using a different topic than default would be nice.

This could be done with commands like "!sessiontopic <topic template>" for topics during sessions, and "!defaulttopic <topic template>" for topics where there aren't any sessions. If command lacks an argument then the bot should reply with the current configured template.

Revision history for this message
Nathan Handler (nhandler) wrote :

The issue is, ClassBot modifies the /topic at the start of a session to include information about the current session. How would you suggest ClassBot do this without knowing the format of the topic it is meant to set?

Changed in classbot:
assignee: nobody → m4v (symphony)
status: New → Incomplete
Revision history for this message
m4v (m4v) wrote :

no I meant modify the topic template or format, so for example

!sessiontopic Welcome to $event - Current Session: $summary - Instructors: $leaders - Slides: $shortslides
!defaulttopic Nothing here!

I don't remember what was the exactly format that ClaseBot was using, but I believe it was very event specific (the event date was in there) so for the next event needs to be edited. Having a command for do this directly without touching the code is better imo.

Revision history for this message
Nathan Handler (nhandler) wrote :

I have partially implemented this feature. Currently, the base portion of the topics is controlled by the irssi settings classroom_topic and classroom_qtopic. These settings control the portion of the /topic displayed before the Event, Session, Instructor, and Slide information (as well as the /topic shown when no session is in progress). It should not be too difficult to add an admin-only command that allows admins without access to the irssi session to adjust these settings.

The one remaining issue is that changes to these settings are not instant. They only take effect the next time the /topic needs updating (when a session starts/ends). This issue will take a little more time to fix. A workaround is to simply add a fake session to the ical, trigger a calendar download (!calendar - admin-only), wait for the /topic to update, delete the session from the ical, and trigger another calendar download.

Changed in classbot:
assignee: m4v (symphony) → Nathan Handler (nhandler)
status: Incomplete → In Progress
Revision history for this message
Nathan Handler (nhandler) wrote :

I have added !topic (!t) and !qtopic (!qt) admin-only commands. These commands take one argument, the new content of the first part of /topic for the classroom and -chat channels respectively. These strings can contain certain variables:

$chan - The main classroom channel (#ubuntu-classroom for classbot)
$qchan - The -chat channel (#ubuntu-classroom-chat for classbot)
$qprefix - The localized question prefix (QUESTION: for classbot)

These will get replaced with the correct values for the session when the /topic is updated.

Keep in mind, these commands do not cause instant changes. The changes will only take affect when a /topic update is necessary (at the start/end of a session).

Changed in classbot:
status: In Progress → Confirmed
assignee: Nathan Handler (nhandler) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.