[ejabberd] how to create chat room programmatically?

Holger Weiß holger at zedat.fu-berlin.de
Tue Aug 19 13:47:43 MSK 2014

* liudanking <liudanking at gmail.com> [2014-08-18 09:49]:
> 1. How can i know the type of a parameter of a erlang function?

Erlang is dynamically typed, so a function parameter doesn't have a
compile-time type.  Erlang nevertheless allows for declaring function
-spec()s¹ these days, and ejabberd does this in some places.

> 2.and is there any document that I can look up ejabberd APIs?

Some of the functions and most of the hooks available to module authors
are documented here:


The more specific functions exported by ejabberd modules are usually not
documented and probably not supported as "official" ejabberd APIs.  You
can certainly use them, but you're on your own there (e.g., I guess
there's no guarantees that the interfaces won't change in future
ejabberd versions).

> for exmaple, how can i query chatroom list using ejabberd API?

There's no function to do this.  mod_muc_admin just reads the database
table directly.²


¹ http://www.erlang.org/doc/reference_manual/typespec.html
² https://github.com/processone/ejabberd-contrib/blob/ccf95a6f/mod_muc_admin/src/mod_muc_admin.erl#L167

More information about the ejabberd mailing list