mirror-nourybot/pkg/commands/coinflip.go

23 lines
321 B
Go
Raw Normal View History

2023-09-07 20:43:16 +02:00
package commands
import (
2024-02-20 22:36:33 +01:00
"github.com/lyx0/nourybot/pkg/common"
2023-09-07 20:43:16 +02:00
)
2024-02-28 11:53:39 +01:00
// Coinflip returns either "Heads!" or "Tails!"
2023-09-07 20:43:16 +02:00
func Coinflip() string {
flip := common.GenerateRandomNumber(2)
var reply string
switch flip {
case 0:
reply = "Heads!"
case 1:
reply = "Tails!"
default:
reply = "Heads!"
}
return reply
}