From a7973459c51485e99f35131e05c817adefbff699 Mon Sep 17 00:00:00 2001 From: Alexander PapaTutuWawa Date: Sun, 13 Jun 2021 00:30:49 +0200 Subject: [PATCH] docs: Small README touch-up --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d778e9..4b30a03 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,10 @@ is just for turning the class into a singleton. What's required is the toplevel constant `NAME`! It is the name of the module as the same time the "command". mira will pass all messages that start with the value of `NAME` to the `on_command` function. It's parameters are the message body -whitespace separated (`cmd`) and the original `aioxmpp` message object (`msg`) +whitespace separated (`cmd`) and the original `aioxmpp` message object (`msg`). + +If you want to add configuration options to your bot, you can use the module's +`get_option(key, default=None)` function, which works exactly like `dict.get(...)`. If you have subcommands, like "new something1" and "new something2", then you can use a subcommand table. It is just a dictionary that tells mira which function @@ -142,6 +145,13 @@ If your users should be able to subscribe to certain events, then you can use th `SubscriptionManager`, available via the module's `_sum` property. It exposes a lot more functions, so it is probably the better to just look at it's code at `mira/subscription.py`. +### Examples + +If the test module `mira.modules.test` is not advanced enough, then you can find more examples here: + +- [JANINE](https://git.polynom.me/PapaTutuWawa/JANINE) +- [My personal modules](https://git.polynom.me/PapaTutuWawa/mira-modules) + ## License See `LICENSE`. \ No newline at end of file