mirror-nourybot/pkg/commands/fill.go

26 lines
464 B
Go
Raw Normal View History

2021-10-19 23:27:55 +02:00
package commands
import (
"fmt"
"strings"
"github.com/lyx0/nourybot/cmd/bot"
)
2021-10-24 17:52:24 +02:00
func Fill(channel, emote string, nb *bot.Bot) {
2021-10-19 23:27:55 +02:00
if emote[0] == '.' || emote[0] == '/' {
nb.Send(channel, ":tf:")
return
}
// Get the length of the emote
emoteLength := (len(emote) + 1)
// Check how often the emote fits into a single message
repeatCount := (499 / emoteLength)
reply := strings.Repeat(fmt.Sprintf(emote+" "), repeatCount)
nb.Send(channel, reply)
}