mirror-nourybot/pkg/commands/coinflip.go
2022-08-08 13:17:42 +02:00

26 lines
409 B
Go

package commands
import (
"fmt"
"github.com/gempir/go-twitch-irc/v3"
"github.com/lyx0/nourybot/pkg/common"
)
func Coinflip(target string, tc *twitch.Client) {
flip := common.GenerateRandomNumber(2)
fmt.Println(flip)
switch flip {
case 0:
common.Send(target, "Heads!", tc)
return
case 1:
common.Send(target, "Tails!", tc)
return
default:
common.Send(target, "Heads!", tc)
return
}
}