Compare commits
No commits in common. "cbb4a2733436e2ffe0c3cb478f7988c3c9e7628e" and "522a9f60b4720b2f1d126f3c16a841be2e8ac188" have entirely different histories.
cbb4a27334
...
522a9f60b4
@ -1,87 +0,0 @@
|
|||||||
package commands
|
|
||||||
|
|
||||||
import (
|
|
||||||
"math/rand"
|
|
||||||
"strings"
|
|
||||||
"sync"
|
|
||||||
|
|
||||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
|
||||||
)
|
|
||||||
|
|
||||||
type BandnameCommand struct{}
|
|
||||||
|
|
||||||
var (
|
|
||||||
bandnameOnce sync.Once
|
|
||||||
randomArticle = []string{"the", ""}
|
|
||||||
randomAdj = []string{
|
|
||||||
"massive", "gargantuan", "scorched", "spiteful", "hateful", "deadly", "unwise", "ignorant",
|
|
||||||
"disgusting", "fearless", "honest", "fleeting", "bloody", "foolish", "unmoving", "black", "sick", "diseased",
|
|
||||||
"undead", "terrible", "unkind", "burning", "disgraced", "conflicted", "malicious", "unclean", "dirty", "unwashed",
|
|
||||||
"muddy", "sickly", "fearless", "moon-lit", "bony", "skeletal", "burning", "flaming", "savage", "wild", "gold",
|
|
||||||
"silver", "overgrown", "wild", "untamed", "ethereal", "ghostly", "haunted", "buried", "nuclear", "radioactive",
|
|
||||||
"mutated", "accidental", "selfish", "self-serving", "hypocritical", "wicked", "dastardly", "dreadful", "obscene",
|
|
||||||
"filthy", "vulgar", "vile", "worthless", "despicable", "cruel", "inhuman", "bloodthirsty", "vicious", "sadistic",
|
|
||||||
"diabolical", "abominable", "bitter", "", "", "", "", "", "", "", "", "", "",
|
|
||||||
}
|
|
||||||
randomNounPlural = []string{
|
|
||||||
"excuses", "clocks", "machines", "needles", "cultists", "slayers", "tyrants", "sound",
|
|
||||||
"vision", "sight", "taste", "smell", "trumpets", "wanderers", "sirens", "kings", "queens", "knights", "priests",
|
|
||||||
"liars", "ogres", "devils", "angels", "demons", "screams", "cries", "pigs", "fiends", "locusts", "worms", "ravens",
|
|
||||||
"vultures", "theives", "warnings", "bodies", "bones", "fingers", "hands", "mouths", "ears", "tongues", "eyes",
|
|
||||||
"magic", "men", "women", "promises", "confessions", "kingdoms", "kisses", "fists", "suns", "moons", "stars", "weight",
|
|
||||||
"altars", "tombstones", "monuments", "rain", "artifacts", "wizards", "warlocks", "barbarians", "druids", "warriors",
|
|
||||||
"monks", "diamonds", "hoard", "embers", "ashes", "swamps", "mountains", "plains", "rivers", "islands", "forests",
|
|
||||||
"mines", "dungeons", "tombs", "hills", "sons", "daughters", "spires", "pyramids", "crypts", "catacombs", "shrines",
|
|
||||||
"pits", "whores", "bandits", "stains", "delusion", "mistakes", "weapons", "chains", "pillars", "beasts", "creatures",
|
|
||||||
}
|
|
||||||
randomNounSingular = []string{
|
|
||||||
"reason", "famine", "disease", "death", "war", "hatred", "sadness", "fear", "rage",
|
|
||||||
"terror", "awe", "disgust", "pain", "suffering", "misery", "avarice", "malice", "lust", "filth", "dirt", "skin",
|
|
||||||
"control", "pride", "decay", "flesh", "bone", "stone", "metal", "iron", "steel", "burden", "memory", "sorrow", "fire",
|
|
||||||
"hell", "silence", "loathing", "contempt", "revulsion", "horror", "abomination", "devastation", "dismay", "dread",
|
|
||||||
"panic", "frenzy", "hysteria", "grief", "remorse", "woe", "anguish", "misery", "desolation", "misfortune", "mourning",
|
|
||||||
"despair", "lamentation", "faith", "eternity", "gloom", "melancholy", "regret", "distress",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func (b BandnameCommand) Name() string {
|
|
||||||
return "bandname"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b BandnameCommand) Help() string {
|
|
||||||
return "Generate a random metal band name"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b BandnameCommand) Execute(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
|
||||||
// Generate band name: [article] [adj] [plural noun] of [singular noun]
|
|
||||||
parts := []string{
|
|
||||||
randChoice(randomArticle),
|
|
||||||
randChoice(randomAdj),
|
|
||||||
randChoice(randomNounPlural),
|
|
||||||
"of",
|
|
||||||
randChoice(randomNounSingular),
|
|
||||||
}
|
|
||||||
// Remove empty strings and extra spaces
|
|
||||||
name := strings.Join(filterNonEmpty(parts), " ")
|
|
||||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, name)
|
|
||||||
msg.ParseMode = "Markdown"
|
|
||||||
bot.Send(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
func randChoice(arr []string) string {
|
|
||||||
return arr[rand.Intn(len(arr))]
|
|
||||||
}
|
|
||||||
|
|
||||||
func filterNonEmpty(arr []string) []string {
|
|
||||||
var out []string
|
|
||||||
for _, s := range arr {
|
|
||||||
if strings.TrimSpace(s) != "" {
|
|
||||||
out = append(out, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
Register(BandnameCommand{})
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
package commands
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"math/rand"
|
|
||||||
"os"
|
|
||||||
"sync"
|
|
||||||
|
|
||||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
|
||||||
)
|
|
||||||
|
|
||||||
type GaynameCommand struct{}
|
|
||||||
|
|
||||||
var (
|
|
||||||
gaynameData struct {
|
|
||||||
First []string `json:"first"`
|
|
||||||
Last []string `json:"last"`
|
|
||||||
}
|
|
||||||
gaynameOnce sync.Once
|
|
||||||
)
|
|
||||||
|
|
||||||
func loadGaynameData() {
|
|
||||||
file, err := os.Open("json/gayname.json")
|
|
||||||
if err != nil {
|
|
||||||
gaynameData.First = []string{"Failed"}
|
|
||||||
gaynameData.Last = []string{"to load"}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
json.NewDecoder(file).Decode(&gaynameData)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g GaynameCommand) Name() string {
|
|
||||||
return "gayname"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g GaynameCommand) Help() string {
|
|
||||||
return "Your gay name"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g GaynameCommand) Execute(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
|
||||||
gaynameOnce.Do(loadGaynameData)
|
|
||||||
user := update.Message.From
|
|
||||||
var result string
|
|
||||||
if user != nil && user.LanguageCode == "pl-PL" {
|
|
||||||
result = user.FirstName + " aka FILTHY PIECE OF RETARD POLAK MIDGETSHIT"
|
|
||||||
} else {
|
|
||||||
first := gaynameData.First[rand.Intn(len(gaynameData.First))]
|
|
||||||
last := gaynameData.Last[rand.Intn(len(gaynameData.Last))]
|
|
||||||
result = user.FirstName + " aka " + first + " " + last
|
|
||||||
}
|
|
||||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, result)
|
|
||||||
bot.Send(msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
Register(GaynameCommand{})
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user