Bootleg bot

From XPUB & Lens-Based wiki
Revision as of 10:23, 3 March 2026 by Manetta (talk | contribs)

This page is prepared for the prototyping class on 3 March 2026 as part of SI29 and follows a Special Issue day with Doriane and Simon fully on topic of The bootleg library.


the zulip bot

First install the requirements listed on this page:

https://zulip.com/help/writing-bots

You can run the bot with:

zulip-bot-shell bootlegbot.py

bootlegbot.py

class BootlegBot(object):
    '''
    This is a small zulip bot to interact with the 👢🦵 library
    '''

    def usage(self):
        return '''Ask the bot about a book and they will search for it in the 👢🦵 library'''

    def handle_message(self, message, bot_handler):
        # This happens when someone write to the bot

        sender = message['sender_full_name']
        content = message['content']
        print(f'{sender} wrote to the bot: "{content}"')

handler_class = BootlegBot

bootlegbot.zuliprc

[api]
email=bootleg-bot@zulip.xpub.nl
key=XXXXXXXX
site=https://zulip.xpub.nl

We need to share the key with each other somehow.

Zulip bot API

https://zulip.com/help/interactive-bots-api