mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
24 lines
382 B
Go
24 lines
382 B
Go
|
package commands
|
||
|
|
||
|
import (
|
||
|
"github.com/gempir/go-twitch-irc/v3"
|
||
|
"github.com/lyx0/nourybot/pkg/common"
|
||
|
)
|
||
|
|
||
|
func Coinflip(target string, tc *twitch.Client) {
|
||
|
flip := common.GenerateRandomNumber(2)
|
||
|
|
||
|
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
|
||
|
}
|
||
|
|
||
|
}
|