# HG changeset patch # User Kim Alvefur # Date 1621866947 -7200 # Node ID 88089c61121dec9c2552b5bfef69187e17413d1e # Parent bcf4518d18d453628da358a317b44e259e6470ae mod_muc_bot: Add a README diff -r bcf4518d18d4 -r 88089c61121d mod_muc_bot/README.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_muc_bot/README.markdown Mon May 24 16:35:47 2021 +0200 @@ -0,0 +1,47 @@ +--- +summary: Module for improving the life of bot authors +--- + +This module makes it easier to write MUC bots by removing the +requirement that the bot be online and joined to the room. + +All the bot needs to do is send a message and this module handles the +rest. + +# Configuration + +Example configuration in Prosody: + +```lua +Component "muc.example.com" "muc" + +modules_enabled = { + "muc_bot", +} +known_bots = { "bot@example.com" } +bots_get_messages = false +ignore_bot_errors = true +``` + +# Sending messages + +Simply send a stanza like this from your bot: + +```xml + + Beep boop, I'm a bot! + Botty + +``` + +## Use with mod_rest + +Using [mod_rest] to interact with MUC suffers from the same need to join +with an online resource, so this module helps with that as well! + +```bash +curl https://xmpp.example.com/rest/message/groupchat/room@muc.example.com \ + -d body="beep boop" \ + -d nick="Botty" +``` +