π± Examples#
In this page, we offer you examples of projects that have been completed using the Python module olvid-bot. Their code is accessible and modifiable to suit your needs.
π€ Chat Bot#
A simple and editable example that allows you to discover the world of Olvid bots.
We are going to set up a command system. The bot waits for specific messages starting with the character !. Each command triggers a different action and/or response.
You can use or modify our Chat Bot example.
Webhook Server#
The use case we have encountered most often when setting up Olvid bots are alert bots. One of the simplest and most universal ways to do this is by using a system of webhooks.
Weβre going to find many different systems for managing and setting up our webhooks, here are a few of them.
Broadcast bot#
The simplest case is what we call a broadcast bot. It listens on a given URL and when it receives an alert, it sends a message to all its contacts and in all its groups.
The code of our broadcast bot is available here: Broadcast Bot.
Its simplicity allows for very short code and it is a great example to start with.
Discussion webhook#
In some cases, we might prefer to have a webhook URL that allows for posting a message in a specific discussion. In this case, it is necessary to create and store a unique URL for each discussion. When this URL is called upon, the message is sent to the associated discussion.
This is the type of model used in Slack messaging, for example.
The code is available here: Webhook Bot.