More commands
This commit is contained in:
66
commands/kekget.go
Normal file
66
commands/kekget.go
Normal file
@ -0,0 +1,66 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
)
|
||||
|
||||
type KekgetCommand struct{}
|
||||
|
||||
func (k KekgetCommand) Name() string {
|
||||
return "kekget"
|
||||
}
|
||||
|
||||
func (k KekgetCommand) Help() string {
|
||||
return "Try to get a KEK or KKK, or even a multiKEK. Usage: /kekget"
|
||||
}
|
||||
|
||||
func (k KekgetCommand) Execute(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
||||
result := generateKekget()
|
||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, result)
|
||||
bot.Send(msg)
|
||||
}
|
||||
|
||||
func generateKekget() string {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
|
||||
// Generate random length between 1 and 20
|
||||
length := rand.Intn(20) + 1
|
||||
|
||||
var text strings.Builder
|
||||
for i := 0; i < length; i++ {
|
||||
if rand.Float64() > 0.5 {
|
||||
text.WriteString("K")
|
||||
} else {
|
||||
text.WriteString("E")
|
||||
}
|
||||
}
|
||||
|
||||
result := text.String()
|
||||
|
||||
// Check for special patterns
|
||||
switch result {
|
||||
case "KEK":
|
||||
return fmt.Sprintf("%s\nYOU WIN TOPKEK!!!", result)
|
||||
case "KKK":
|
||||
return fmt.Sprintf("%s\nYOU WIN TOPKKK HEIL HITLER!!!", result)
|
||||
case "KEKKEK":
|
||||
return fmt.Sprintf("%s\nYOU WIN DOUBLE TOPKEKKEK!!!", result)
|
||||
case "KEKKEKKEK":
|
||||
return fmt.Sprintf("%s\nYOU WIN ULTIMATE TRIPLE TOPKEKKEKKEK!!!", result)
|
||||
case "KEKKEKKEKKEK":
|
||||
return fmt.Sprintf("%s\nQUADDRUPPLE TOPKEKKEKKEKKEK!!! YOU ARE GAY!!!", result)
|
||||
case "KEKKEKKEKKEKKEK":
|
||||
return fmt.Sprintf("%s\nQUINTUPLE TOPKEKKEKKEKKEKKEK!!! UNBELIEVABLE M8!!!", result)
|
||||
default:
|
||||
return fmt.Sprintf("%s\nLength: %d", result, len(result))
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
Register(KekgetCommand{})
|
||||
}
|
Reference in New Issue
Block a user