How to write your own Zulip bot
Zulip is an open-source group chat application used by various open-source organizations which give a tough competition to slack.
Zulip uses python and java API for providing back-end for developers to develop in zulip realm. the complete zulip documentation for setup can be found here how to setup zulip development environment on ubuntu 18.04
To set up the development environment for creating a Zulip bot, you need to clone the python-zulip-api repository. Follow the steps to set up the environment.
- Clone the python-zulip-api repository.
git clone https://github.com/zulip/python-zulip-api.git
- Change directory to the cloned repository.
- Make sure you have in the right directory and use the below commands to start the development environment
- Finally activate the virtual environment by using the below command
What is bot.py? and how to create it??
you need to files in a folder to run your bot 1]bot.py file 2] .zuliprc file in a folder.
1] install the necessary file such as pprint, zulip, sys, re, json, httplib2, os using pip install command
2]import required files into your bot.py file according to your needs.
3]BOT_MAIL = “<your chat-bot name>@<organisation name>.zulipchat.com”
4] defining the main part of bot that is constructor function Inside the class, define constructor function __init__. This will contain the details about the client, calling the subscribe_all() function and an array that will contain all the keywords to look out for.this will look for required arrays.
5] the main function: in the main function an object of class ZulipBot will be created and this will call bot.
Structure of bot
For running bot and testing the bot's output follow the tutorial
Writing interactive bots (Zulip API Documentation)
This guide is about writing and testing interactive bots. We assume familiarity with our guide for running bots. | On…
hope this will help you !!