mod_announce

Sometimes it is useful to send messages to all online users, maybe because of an upcoming outage or maintenance period. mod_announce allows administrators to do that.

Details

Message method

Only administrators can send announcements. To send an announcement an administrator needs to send a message to HOST/announce/online. For example example.com/announce/online

Ad-Hoc command

The module also provides an Ad-Hoc command. Using a client with support for Ad-hoc commands, look for “Send Announcement to Online Users”, then simply fill out the form and send.

Shell command

Announcements can also be sent from the shell or the command line.

announce:all(host, text)
Send announcement to all users on the host
announce:online(host, text)
Send announcement to all online users on the host
announce:role(host, role, text)
Send announcement to users with a specific role on the host
# prosodyctl shell
prosody> announce:online("example.com", "Hello from the Shell!")
| OK: Announcement sent to 3 users
# prosodyctl shell announce online example.com "Hello from $SHELL"

Permissions

Permission Granted to Role
announce:send-announcement prosody:admin

Configuration

Option Default Notes
No options

Example

modules_enabled = {
    -- Other modules
    "announce"; -- Enable mod_announce
}