diff options
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 7206bfdd..d6f73ffd 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -27,14 +27,12 @@ type MMMessage struct { type Bslack struct { mh *matterhook.Client sc *slack.Client - Config *config.Protocol rtm *slack.RTM Plus bool - Remote chan config.Message Users []slack.User - Account string si *slack.Info channels []slack.Channel + *config.BridgeConfig } var flog *log.Entry @@ -44,12 +42,8 @@ func init() { flog = log.WithFields(log.Fields{"module": protocol}) } -func New(cfg config.Protocol, account string, c chan config.Message) *Bslack { - b := &Bslack{} - b.Config = &cfg - b.Remote = c - b.Account = account - return b +func New(cfg *config.BridgeConfig) *Bslack { + return &Bslack{BridgeConfig: cfg} } func (b *Bslack) Command(cmd string) string { @@ -161,7 +155,7 @@ func (b *Bslack) Send(msg config.Message) (string, error) { np.AsUser = true } np.Username = nick - np.IconURL = config.GetIconURL(&msg, b.Config) + np.IconURL = config.GetIconURL(&msg, &b.Config) if msg.Avatar != "" { np.IconURL = msg.Avatar } |