Closed rjanja closed 7 years ago
Hello @rjanja,
First off, thank you for your interest in helping to improve Hedwig! It is much appreciated.
This PR has a couple issues that I'll outline here.
Since module attributes are baked in at compile-time, if you're running multiple bots, and each are configured to use those responders, it won't work as intended.
This is a problem with one of the main goals of Hedwig (allows many bots to be running at a time).
The second issue is that things like emoji
and thumbnail
don't necessarily translate well to all different chat services (Slack, XMPP, IRC, etc.).
I would prefer to build a different abstraction for this. I have some things in mind, but I haven't started working on them yet. I am currently reworking the Hedwig.Robot
so that it is a proper OTP behaviour and will allow greater flexibility for users.
Those changes are coming in 2.0 (no target date yet, but I have started work on that).
In the future, please feel free to create an issue to start a discussion.
First go at implementing bot identities in responders. Responders can define
@bot_name
,@bot_emoji
,@bot_thumbnail
attributes that will be used with their messages when doing asend
oremote
(but notreply
). The name must be overridden for this to take effect.Identity is used (name only) in the console adapter.
Additionally,
bot_identity/2
can be overridden by the individual responder to allow for custom behavior. See labzero/hedwig_simple_responders@6ff56081cf6a82e1f3e7e77c1dcc1c058968c572 for an example of this.