To prevent bots from accidently entering an infinite message loop,
where they send messages as a reacting to their own messages,
this commit adds the RateLimit class to run.py. It specifies how
many messages can be sent in a given time interval. If this rate
is exceeded, run.py exits with an error.
Fixes#3210.
Now the development API (which is inside the repo, api/) is used when the envionment is a development one.
Credits to Steve Howell (@showell) for the instructions on how to fix this.
- Expose some information about user profile in `RestrictedClient`
class, like `full_name` and `email` of the user.
- Add `client` argument to `triage_message()`, now it's possible to
call bot with another method instead of calling the specified
keyword.
Allow to import code from subdirectory of `contrib_bots/lib`.
Because sometimes bot requires grouping in their directory,
especially for the bot that has configuartion file and documentation.
This allows bots to be stateful. It doesn't handle persistence
after the bot shuts down, but it does store state between
invocations of handle_message.
This commit also starts to build out the infrastructure for
helping Zulip contributors to more easily author bots in
a way that sets up for running some bots on the server itself.