How can I write ejabberd hooks in elixir?

I want to use ejabberd server for chat server, but I need to use elixir hooks for that server do not have properties, is it possible to success this one?

I think your best bet is using an ejabberd module, and register your hook in the start function inherited from the gen_mod behavior. This tutorial can show you how to build a module with hook support: Elixir Sips: ejabberd with Elixir – Part 2 / ProcessOne and here is a small ‘real’ module I wrote a while back as an example: mod_auto_cluster/mod_auto_cluster.ex at master · mpope9/mod_auto_cluster · GitHub

1 Like

thx so much, I like it, it is amazing :slight_smile:

1 Like