Mercurial > prosody-modules
annotate mod_muc_bot/README.md @ 6556:7477e97a9045
mod_firewall: Apply pre-reload state before re-reading config
This change makes load/reload a bit more robust. module.load() runs before
module.restore() and it reads from the config and updates the state (if
needed).
However, after this, module.restore() could run and apply the old state again.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 24 May 2026 20:03:20 +0100 |
| parents | fe081789f7b5 |
| children |
| rev | line source |
|---|---|
| 4568 | 1 --- |
| 2 summary: Module for improving the life of bot authors | |
| 3 --- | |
| 4 | |
| 5 This module makes it easier to write MUC bots by removing the | |
| 6 requirement that the bot be online and joined to the room. | |
| 7 | |
| 8 All the bot needs to do is send a message and this module handles the | |
| 9 rest. | |
| 10 | |
| 11 # Configuration | |
| 12 | |
| 13 Example configuration in Prosody: | |
| 14 | |
| 15 ```lua | |
| 16 Component "muc.example.com" "muc" | |
| 17 | |
| 18 modules_enabled = { | |
| 19 "muc_bot", | |
| 20 } | |
| 21 known_bots = { "bot@example.com" } | |
| 22 bots_get_messages = false | |
| 23 ignore_bot_errors = true | |
| 24 ``` | |
| 25 | |
| 26 # Sending messages | |
| 27 | |
| 28 Simply send a stanza like this from your bot: | |
| 29 | |
| 30 ```xml | |
| 31 <message type="groupchat" to="channel@muc.example.com"> | |
| 32 <body>Beep boop, I'm a bot!</body> | |
| 33 <nick xmlns="http://jabber.org/protocol/nick">Botty</nick> | |
| 34 </message> | |
| 35 ``` | |
| 36 | |
| 37 ## Use with mod_rest | |
| 38 | |
| 39 Using [mod_rest] to interact with MUC suffers from the same need to join | |
| 40 with an online resource, so this module helps with that as well! | |
| 41 | |
| 42 ```bash | |
| 43 curl https://xmpp.example.com/rest/message/groupchat/room@muc.example.com \ | |
| 44 -d body="beep boop" \ | |
| 45 -d nick="Botty" | |
| 46 ``` | |
| 47 | |
|
4569
9cbdb60e21f2
mod_muc_bot: Add Compatibility section to README
Kim Alvefur <zash@zash.se>
parents:
4568
diff
changeset
|
48 # Compatibility |
|
9cbdb60e21f2
mod_muc_bot: Add Compatibility section to README
Kim Alvefur <zash@zash.se>
parents:
4568
diff
changeset
|
49 |
|
5011
55cf7f063af6
mod_muc_bot/README: Update to account for 0.12 going stable
Kim Alvefur <zash@zash.se>
parents:
4569
diff
changeset
|
50 Works with Prosody 0.12 or later. |
