some testing ang enchancments
This commit is contained in:
51
plugins/fun.go
Normal file
51
plugins/fun.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea"
|
||||
)
|
||||
|
||||
func RegisterFun(bot *laniakea.Bot) {
|
||||
p := laniakea.NewPlugin("Fun")
|
||||
p.Command(beautyFont, "bf")
|
||||
p.Command(beautyFontHeart, "bfh")
|
||||
bot.AddPlugins(p.Build())
|
||||
}
|
||||
|
||||
var ligatures = map[string]string{
|
||||
"A": "𝐴", "B": "𝐵", "C": "𝐶", "D": "𝐷", "E": "𝐸", "F": "𝐹", "G": "𝐺", "H": "𝐻", "I": "𝐼", "J": "𝐽",
|
||||
"K": "𝐾", "L": "𝐿", "M": "𝑀", "N": "𝑁", "O": "𝑂", "P": "𝑃", "Q": "𝑄", "R": "𝑅", "S": "𝑆", "T": "𝑇",
|
||||
"U": "𝑈", "V": "𝑉", "W": "𝑊", "X": "𝑋", "Y": "𝑌", "Z": "𝑍",
|
||||
"a": "𝑎", "b": "𝑏", "c": "𝑐", "d": "𝑑", "e": "𝑒", "f": "𝑓", "g": "𝑔", "h": "𝘩", "i": "𝑖", "j": "𝑗",
|
||||
"k": "𝑘", "l": "𝑙", "m": "𝑚", "n": "𝑛", "o": "𝑜", "p": "𝑝", "q": "𝑞", "r": "𝑟", "s": "𝑠", "t": "𝑡", "u": "𝑢",
|
||||
"v": "𝑣", "w": "𝑤", "x": "𝑥", "y": "𝑦", "z": "𝑧",
|
||||
}
|
||||
|
||||
func beautyFont(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
m := strings.Join(ctx.Args, " ")
|
||||
out := ""
|
||||
for _, r := range m {
|
||||
beautyL, ok := ligatures[string(r)]
|
||||
if !ok {
|
||||
out += string(r)
|
||||
} else {
|
||||
out += beautyL
|
||||
}
|
||||
}
|
||||
ctx.Answer(out)
|
||||
}
|
||||
|
||||
func beautyFontHeart(ctx *laniakea.MsgContext, db *laniakea.DatabaseContext) {
|
||||
m := strings.Join(ctx.Args, " ")
|
||||
out := ""
|
||||
for _, r := range m {
|
||||
beautyL, ok := ligatures[string(r)]
|
||||
if !ok {
|
||||
out += string(r)
|
||||
} else {
|
||||
out += beautyL
|
||||
}
|
||||
}
|
||||
ctx.Answer(out + "♡")
|
||||
}
|
||||
Reference in New Issue
Block a user