From ce21ba154585395e792c059ac156299071405247 Mon Sep 17 00:00:00 2001 From: Duco van Amstel Date: Thu, 15 Nov 2018 19:43:43 +0000 Subject: Fix golint linter issues and enable it in CI (#593) --- bridge/discord/discord.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bridge/discord') 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) -- cgit v1.2.3