23 lines
415 B
Go
23 lines
415 B
Go
package public
|
|
|
|
import (
|
|
"math/rand"
|
|
"velox-bot/internal/commands/fun/shared"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
)
|
|
|
|
var Coinflip = &discordgo.ApplicationCommand{
|
|
Name: "coinflip",
|
|
Description: "Flip a coin",
|
|
}
|
|
|
|
func CoinflipHandler(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
|
num := rand.Intn(2)
|
|
if num == 0 {
|
|
shared.Respond(s, i, "Heads!")
|
|
} else {
|
|
shared.Respond(s, i, "Tails!")
|
|
}
|
|
}
|