I’ve been toying with one written using CPAN’s Net::Async::Matrix module. It is a bit rough around the edges and not well tested. But it seem to be working OK in the simple environment that I’ve been able to test it on. I’ll try to clean it up a bit and post it on pagure.io so others can check it out if they are interested. Personally, I’ve found the framework quite easy to work with.
For anyone who may be interested, I’ve uploaded the custom matrix chatbot that I’ve been playing with.
I’ve uploaded two versions. nonbot is a very minimal example that only responds to two queries. It will respond to
hi <user-who-said-hello>. It will respond to
#search <string/fas_id> with any names that match (or partially match) the provided string. The
#search function demonstrates interacting with the matrix client REST API.
nonbot: Overview - nonbot - Pagure.io
zinebot: Overview - zinebot - Pagure.io
Here is a screenshot of zinebot in action.
In the above screenshot, the chatbot is signed in with the same username as myself. So it is difficult to see who is entering what. But basically, the chatbot is advancing the topics/sections for the Fedora Magazine meeting script that is documented here. When I enter
moving along, the bot posts the commands to advance to the next topic (so I don’t have to copy-and-paste them). Also, when I enter
agreed ? or
agreed !, the bot queries the Fedora Magazine Kanban board and posts the currently-scheduled articles from the to edit column.
One very neat thing about the matrix chatbot is how easy it is to style the text. In the schedule output, I’ve applied some bold and italic markup to make the schedule a little easier to read.
Hope others will find this useful. Be warned that I am very novice at writing chatbots (these are the first I’ve ever attempted).
Also, if someone thinks this post would be better placed under a different thread, by all means, feel free to move it.
ooh, Perl. I’ve not written Perl in at least a decade, I may not be a great collaborator there . I was planning to use either a Maubot plugin or Simple Matrix Bot Lib, both of which are Python. (Although I’m no better at Python, tbh, I use R day-to-day )
Agree with the styling point, and also reactions (although that’s not IRC-friendly). I think there’s also scope for (ab)using Markdown - e.g. for my pollbot I plan to have the user make 1 post, in the format:
!poll create do we like Matrix? - yes - no
And the bot can parse each item in the list as a vote option, spit it back with numbers & emojis, and users can vote either by reacting with the appropriate emoji, or with “!vote option”. Lots of potential!
As for running a plethora of bots, you could write one bot to check to see if all the bots are running and connected. One bot to rule them all.