mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
fix splitting messages not working
This commit is contained in:
parent
340afc9e4d
commit
8e9d634df8
|
@ -27,6 +27,18 @@ func (b *Bot) Send(target, text string) {
|
|||
// text = ". " + text
|
||||
// }
|
||||
|
||||
// If a message is too long for a single twitch
|
||||
// message, split it into two messages.
|
||||
if len(text) > 500 {
|
||||
firstMessage := text[0:499]
|
||||
secondMessage := text[499:]
|
||||
|
||||
b.TwitchClient.Say(target, firstMessage)
|
||||
b.TwitchClient.Say(target, secondMessage)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// check the message for bad words before we say it
|
||||
messageBanned, banReason := CheckMessage(text)
|
||||
if messageBanned {
|
||||
|
@ -40,16 +52,4 @@ func (b *Bot) Send(target, text string) {
|
|||
return
|
||||
}
|
||||
|
||||
// If a message is too long for a single twitch
|
||||
// message, split it into two messages.
|
||||
if len(text) > 500 {
|
||||
firstMessage := text[0:499]
|
||||
secondMessage := text[499:]
|
||||
|
||||
b.TwitchClient.Say(target, firstMessage)
|
||||
b.TwitchClient.Say(target, secondMessage)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue