diff options
author | Duco van Amstel <duco.vanamstel@gmail.com> | 2018-11-15 19:43:43 +0000 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-15 20:43:43 +0100 |
commit | ce21ba154585395e792c059ac156299071405247 (patch) | |
tree | f76f4617cc2c099a9a2e97bc85fce28cf04010b1 /bridge/discord | |
parent | c89085bf44333b4decd75e30cec5849dca859938 (diff) | |
download | matterbridge-msglm-ce21ba154585395e792c059ac156299071405247.tar.gz matterbridge-msglm-ce21ba154585395e792c059ac156299071405247.tar.bz2 matterbridge-msglm-ce21ba154585395e792c059ac156299071405247.zip |
Fix golint linter issues and enable it in CI (#593)
Diffstat (limited to 'bridge/discord')
-rw-r--r-- | bridge/discord/discord.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index b41c2e50..d3fc8eb4 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -129,7 +129,7 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { } // Make a action /me of the message - if msg.Event == config.EVENT_USER_ACTION { + if msg.Event == config.EventUserAction { msg.Text = "_" + msg.Text + "_" } @@ -147,7 +147,7 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { // Use webhook to send the message if wID != "" { // skip events - if msg.Event != "" && msg.Event != config.EVENT_JOIN_LEAVE && msg.Event != config.EVENT_TOPIC_CHANGE { + if msg.Event != "" && msg.Event != config.EventJoinLeave && msg.Event != config.EventTopicChange { return "", nil } b.Log.Debugf("Broadcasting using Webhook") @@ -179,7 +179,7 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { b.Log.Debugf("Broadcasting using token (API)") // Delete message - if msg.Event == config.EVENT_MSG_DELETE { + if msg.Event == config.EventMsgDelete { if msg.ID == "" { return "", nil } @@ -217,7 +217,7 @@ func (b *Bdiscord) Send(msg config.Message) (string, error) { } func (b *Bdiscord) messageDelete(s *discordgo.Session, m *discordgo.MessageDelete) { - rmsg := config.Message{Account: b.Account, ID: m.ID, Event: config.EVENT_MSG_DELETE, Text: config.EVENT_MSG_DELETE} + rmsg := config.Message{Account: b.Account, ID: m.ID, Event: config.EventMsgDelete, Text: config.EventMsgDelete} rmsg.Channel = b.getChannelName(m.ChannelID) if b.UseChannelID { rmsg.Channel = "ID:" + m.ChannelID @@ -300,7 +300,7 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat var ok bool rmsg.Text, ok = b.replaceAction(rmsg.Text) if ok { - rmsg.Event = config.EVENT_USER_ACTION + rmsg.Event = config.EventUserAction } b.Log.Debugf("<= Sending message from %s on %s to gateway", m.Author.Username, b.Account) |