From 73df47eb45142360612f9429bb5471cdcc6e1eda Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 19 Jan 2021 08:24:51 +0100 Subject: [PATCH] Document Bot attributes/functions Closes https://git.autonomic.zone/decentral1se/xbotlib/issues/35. --- CHANGELOG.md | 4 ++++ README.md | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44f60f6..461c55e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # xbotlib x.x.x (UNRELEASED) +# xbotlib 0.13.1 (2021-01-19) + +- Document `Bot` attributes/functions ([#35](https://git.autonomic.zone/decentral1se/xbotlib/issues/35)) + # xbotlib 0.13.0 (2021-01-18) - Allow commands to be detected in all parts of the message diff --git a/README.md b/README.md index 8d28757..9572ee6 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ on and are still going on in - [Bot.group(message)](#bot-group-message) - [Bot.serve(request)](#bot-serve-request) - [SimpleMessage](#simplemessage) + - [Bot](#bot) - [Working with your bot](#working-with-your-bot) - [Documentation](#documentation) - [Commands](#commands) @@ -121,6 +122,22 @@ Attributes: - **type**: the type of message - **url**: The URL of a sent file +### Bot + +> Bot.reply(message, to=None, room=None) + +Send a reply back. + +Arguments: + +- **message**: the message that is sent +- **to**: the user to send the reply to +- **room**: the room to send the reply to + +Other useful attributes on the `Bot` class are: + +- **self.db**: The [Redis database](#redis-key-value-storage) if you're using it + ## Working with your bot ### Documentation