Teams bot

As many posts on this blog can attest, I am generally very pro-bot. Bots needn’t produce spam and influence campaigns; instead, they can provide useful or amusing content in many contexts. I have long wanted to make a Microsoft Teams bot in the spirit of Zoia, the Code4Lib IRC bot. In its day, Zoia was a major participant in the C4L IRC channel[1]. People would frequently have extended conversations with the Zoia. It was great.

Even a fraction of Zoia’s functionality would be wonderful for our Teams channel. But I bet a lot of programming hours went into building Zoia, and I can’t remotely aim at replicating it. But we can start somewhere. I had initially hoped to build a replying bot, that would provide amusing replies when asked. But in the end, I had to start with an even more basic bot: one that posts content at regularly scheduled intervals.

This compromise was largely due to the tooling that is available for Teams bots. These tools are, uh, not great. More than once have I opened the Teams documentation in the hope of getting started and have given up without even beginning to write any code. It’s not particularly welcoming. But this weekend I decided to push through.

The use case I settled on was to occasionally remind the librarians to update their out-of-date LibGuides. This involved querying the LibGuides API for stale guides (pretty easy) and then producing an “adaptive card” to post to Teams (much more complicated). This involved learning a bit about JSON schemas (not sure why this was necessary) and how to structure adaptive cards. I used Aider with the gpt-5 model to help a bit, but honestly it was not super useful when it came to solving the harder problems.

I looked into using Gitea actions to run the bot[2], but this has more overhead than I anticipated, so I am running the bot on my laptop on a schedule with systemd. I have never tried this approach before, so we will see how it goes!

[1] Maybe it still is? I have not logged into C4L IRC in a long time.
[2] I am slowly weaning myself off of GitHub.