mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
chore(lint): 改进代码样式 (#1192)
Some checks are pending
打包最新版为 Docker Image / build docker (push) Waiting to run
最新版 / Build binary CI (386, linux) (push) Waiting to run
最新版 / Build binary CI (386, windows) (push) Waiting to run
最新版 / Build binary CI (amd64, linux) (push) Waiting to run
最新版 / Build binary CI (amd64, windows) (push) Waiting to run
最新版 / Build binary CI (arm, linux) (push) Waiting to run
最新版 / Build binary CI (arm64, linux) (push) Waiting to run
PushLint / lint (push) Waiting to run
Some checks are pending
打包最新版为 Docker Image / build docker (push) Waiting to run
最新版 / Build binary CI (386, linux) (push) Waiting to run
最新版 / Build binary CI (386, windows) (push) Waiting to run
最新版 / Build binary CI (amd64, linux) (push) Waiting to run
最新版 / Build binary CI (amd64, windows) (push) Waiting to run
最新版 / Build binary CI (arm, linux) (push) Waiting to run
最新版 / Build binary CI (arm64, linux) (push) Waiting to run
PushLint / lint (push) Waiting to run
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
cd16a755d7
commit
35292a69fc
@ -25,9 +25,10 @@ var fumoChars = []string{
|
||||
"Fumo/", "fUmo/",
|
||||
}
|
||||
|
||||
//Base64 2 Fumo
|
||||
// Base64 2 Fumo
|
||||
// 创建编码映射表
|
||||
var encodeMap = make(map[byte]string)
|
||||
|
||||
// 创建解码映射表
|
||||
var decodeMap = make(map[string]byte)
|
||||
|
||||
@ -41,7 +42,7 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
//加密
|
||||
// 加密
|
||||
func encryptFumo(text string) string {
|
||||
if text == "" {
|
||||
return "请输入要加密的文本"
|
||||
@ -63,7 +64,7 @@ func encryptFumo(text string) string {
|
||||
return result
|
||||
}
|
||||
|
||||
//解密
|
||||
// 解密
|
||||
func decryptFumo(fumoText string) string {
|
||||
if fumoText == "" {
|
||||
return "请输入要解密的Fumo语密文"
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
)
|
||||
|
||||
//hou
|
||||
// hou
|
||||
func houEncryptHandler(ctx *zero.Ctx) {
|
||||
text := ctx.State["regex_matched"].([]string)[1]
|
||||
result := encodeHou(text)
|
||||
@ -19,7 +19,7 @@ func houDecryptHandler(ctx *zero.Ctx) {
|
||||
ctx.SendChain(message.Text(result))
|
||||
}
|
||||
|
||||
//fumo
|
||||
// fumo
|
||||
func fumoEncryptHandler(ctx *zero.Ctx) {
|
||||
text := ctx.State["regex_matched"].([]string)[1]
|
||||
result := encryptFumo(text)
|
||||
|
||||
@ -10,6 +10,7 @@ var houCodebook = []string{
|
||||
"齁", "哦", "噢", "喔", "咕", "咿", "嗯", "啊",
|
||||
"~", "哈", "!", "唔", "哼", "❤", "呃", "呼",
|
||||
}
|
||||
|
||||
// 索引: 0 1 2 3 4 5 6 7
|
||||
// 8 9 10 11 12 13 14 15
|
||||
|
||||
|
||||
@ -21,11 +21,11 @@ func init() {
|
||||
PublicDataFolder: "Crypter",
|
||||
})
|
||||
|
||||
//hou
|
||||
// hou
|
||||
engine.OnRegex(`^(?:齁语加密|h加密)\s*(.+)$`).SetBlock(true).Handle(houEncryptHandler)
|
||||
engine.OnRegex(`^(?:齁语解密|h解密)\s*(.+)$`).SetBlock(true).Handle(houDecryptHandler)
|
||||
|
||||
//Fumo
|
||||
// Fumo
|
||||
engine.OnRegex(`^fumo加密\s*(.+)$`).SetBlock(true).Handle(fumoEncryptHandler)
|
||||
engine.OnRegex(`^fumo解密\s*(.+)$`).SetBlock(true).Handle(fumoDecryptHandler)
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user