Skip to content

Commit

Permalink
cmd/disrelay: scrub newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
Xe committed Nov 26, 2017
1 parent 01218e9 commit d4a0a8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

builds:
- binary: disrelay
main: ./cmd/disrelay/main.go
Expand Down
2 changes: 1 addition & 1 deletion box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

cmd "/usr/local/bin/disrelay"

tag "xena/disrelay:1.0"
tag "xena/disrelay:1.2"
8 changes: 5 additions & 3 deletions cmd/disrelay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ func (b *bot) handleDiscord(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}

err = b.messageIRC(ic, m.Author.Username, msg)
if err != nil {
ln.FatalErr(ctx, err, ln.F{"discord_channel": m.ChannelID, "discord_username": m.Author.Username, "msg": msg})
for _, ms := range strings.Split(msg, "\n") {
err = b.messageIRC(ic, m.Author.Username, ms)
if err != nil {
ln.FatalErr(ctx, err, ln.F{"discord_channel": m.ChannelID, "discord_username": m.Author.Username, "msg": msg})
}
}
}

Expand Down

0 comments on commit d4a0a8f

Please sign in to comment.