all repos — paprika @ 4f5ac048596e44147f9d9db0731b987a3e92d1bf

go rewrite of taigabot

Meme plugin(s) (#16)

* Initial meme plugin

With some clever "obfuscation".

* Add .kiss/.love

* Add .increase/.decrease

* Some more meme shit

* Hug!
Anirudh Oppiliappan x@icyphox.sh
Thu, 30 Dec 2021 22:19:34 +0530
commit

4f5ac048596e44147f9d9db0731b987a3e92d1bf

parent

1fb89eade8189decfa4977aa0c55a8a79e0d01fa

1 files changed, 79 insertions(+), 0 deletions(-)

jump to
A plugins/meme.go

@@ -0,0 +1,79 @@

+package plugins + +import ( + "encoding/base64" + "fmt" + "math/rand" + "strings" + "time" + + "gopkg.in/irc.v3" +) + +func init() { + Register(Meme{}) +} + +type Meme struct{} + +var n []byte + +func (Meme) Triggers() []string { + n, _ = base64.StdEncoding.DecodeString("bmlnZ2Vy") + return []string{ + "." + string(n), + ".kiss", + ".increase", + ".decrease", + ".sniff", + ".hug", + } +} + +func (Meme) Execute(m *irc.Message) (string, error) { + parts := strings.SplitN(m.Trailing(), " ", 2) + trigger := parts[0] + rand.Seed(time.Now().Unix()) + var target string + if len(parts) > 1 { + target = parts[1] + } else { + target = m.Prefix.Name + } + + switch trigger { + case "." + string(n): + // lol + if m.Prefix.Name == "IRSSucks" { + target = "IRSSucks" + } + word := string(n) + if rand.Intn(10) == 8 { + // Easter egg! Only teh cool h4x0rz will get this. + word = "bmlnZ2Vy" + } + return fmt.Sprintf("%s is a %s", target, word), nil + case ".kiss", ".love": + kaomoji := []string{ + "(●´□`)", "(。・ω・。)ノ", "(。’▽’。)", + "(ෆ ͒•∘̬• ͒)◞", "( •ॢ◡-ॢ)-", "⁽⁽ପ( •ु﹃ •ु)​.⑅*", + "(๑ Ỡ ◡͐ Ỡ๑)ノ", "◟(◔ั₀◔ั )◞ ༘", + } + return fmt.Sprintf( + "%s \x02\x034 。。・゜゜・。。・❤️ %s ❤️ \x03\x02", + kaomoji[rand.Intn(len(kaomoji))], + target, + ), nil + case ".increase", ".decrease": + return fmt.Sprintf( + "\x02[QUALITY OF CHANNEL SIGNIFICANTLY %sD]\x02", + strings.ToUpper(trigger[1:]), + ), nil + case ".sniff": + return fmt.Sprintf("huffs %s's hair while sat behind them on the bus.", target), nil + case ".hug": + return fmt.Sprintf("(>^_^)>❤️ %s ❤️<(^o^<)", target), nil + + } + return "", nil +}