Skip to content

Commit

Permalink
Fix: Using wrong event codes for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
llmII committed Mar 3, 2021
1 parent b723383 commit 1cb6bfd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bridge/irc_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (i *ircListener) OnNickRelayToDiscord(event *irc.Event) {
}

newNick := event.Message()
message := i.bridge.ircManager.formatDiscordMessage(event.Code, event, newNick, "")
message := i.bridge.ircManager.formatDiscordMessage("NICK", event, newNick, "")

// if the message is empty...
if message == "" {
Expand Down Expand Up @@ -147,21 +147,21 @@ func (i *ircListener) OnJoinQuitCallback(event *irc.Event) {

switch event.Code {
case "STJOIN":
message = manager.formatDiscordMessage(event.Code, event, "", "")
message = manager.formatDiscordMessage("JOIN", event, "", "")
case "STPART":
if len(event.Arguments) > 1 {
content = event.Arguments[1]
}
message = manager.formatDiscordMessage(event.Code, event, content, "")
message = manager.formatDiscordMessage("PART", event, content, "")
case "STQUIT":
content := event.Nick
if len(event.Arguments) == 1 {
content = event.Arguments[0]
}
message = manager.formatDiscordMessage(event.Code, event, content, "")
message = manager.formatDiscordMessage("QUIT", event, content, "")
case "KICK":
target, content = event.Arguments[1], event.Arguments[2]
message = manager.formatDiscordMessage(event.Code, event, content, target)
message = manager.formatDiscordMessage("KICK", event, content, target)
}

// if the message is empty...
Expand Down

0 comments on commit 1cb6bfd

Please sign in to comment.