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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2025-09-02 13:13:22 +08:00 committed by GitHub
parent cd16a755d7
commit 35292a69fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 25 deletions

View File

@ -25,9 +25,10 @@ var fumoChars = []string{
"Fumo/", "fUmo/", "Fumo/", "fUmo/",
} }
//Base64 2 Fumo // Base64 2 Fumo
// 创建编码映射表 // 创建编码映射表
var encodeMap = make(map[byte]string) var encodeMap = make(map[byte]string)
// 创建解码映射表 // 创建解码映射表
var decodeMap = make(map[string]byte) var decodeMap = make(map[string]byte)
@ -41,7 +42,7 @@ func init() {
} }
} }
//加密 // 加密
func encryptFumo(text string) string { func encryptFumo(text string) string {
if text == "" { if text == "" {
return "请输入要加密的文本" return "请输入要加密的文本"
@ -63,7 +64,7 @@ func encryptFumo(text string) string {
return result return result
} }
//解密 // 解密
func decryptFumo(fumoText string) string { func decryptFumo(fumoText string) string {
if fumoText == "" { if fumoText == "" {
return "请输入要解密的Fumo语密文" return "请输入要解密的Fumo语密文"

View File

@ -6,7 +6,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/message" "github.com/wdvxdr1123/ZeroBot/message"
) )
//hou // hou
func houEncryptHandler(ctx *zero.Ctx) { func houEncryptHandler(ctx *zero.Ctx) {
text := ctx.State["regex_matched"].([]string)[1] text := ctx.State["regex_matched"].([]string)[1]
result := encodeHou(text) result := encodeHou(text)
@ -19,7 +19,7 @@ func houDecryptHandler(ctx *zero.Ctx) {
ctx.SendChain(message.Text(result)) ctx.SendChain(message.Text(result))
} }
//fumo // fumo
func fumoEncryptHandler(ctx *zero.Ctx) { func fumoEncryptHandler(ctx *zero.Ctx) {
text := ctx.State["regex_matched"].([]string)[1] text := ctx.State["regex_matched"].([]string)[1]
result := encryptFumo(text) result := encryptFumo(text)

View File

@ -10,6 +10,7 @@ var houCodebook = []string{
"齁", "哦", "噢", "喔", "咕", "咿", "嗯", "啊", "齁", "哦", "噢", "喔", "咕", "咿", "嗯", "啊",
"", "哈", "", "唔", "哼", "❤", "呃", "呼", "", "哈", "", "唔", "哼", "❤", "呃", "呼",
} }
// 索引: 0 1 2 3 4 5 6 7 // 索引: 0 1 2 3 4 5 6 7
// 8 9 10 11 12 13 14 15 // 8 9 10 11 12 13 14 15

View File

@ -21,11 +21,11 @@ func init() {
PublicDataFolder: "Crypter", PublicDataFolder: "Crypter",
}) })
//hou // hou
engine.OnRegex(`^(?:齁语加密|h加密)\s*(.+)$`).SetBlock(true).Handle(houEncryptHandler) engine.OnRegex(`^(?:齁语加密|h加密)\s*(.+)$`).SetBlock(true).Handle(houEncryptHandler)
engine.OnRegex(`^(?:齁语解密|h解密)\s*(.+)$`).SetBlock(true).Handle(houDecryptHandler) 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(fumoEncryptHandler)
engine.OnRegex(`^fumo解密\s*(.+)$`).SetBlock(true).Handle(fumoDecryptHandler) engine.OnRegex(`^fumo解密\s*(.+)$`).SetBlock(true).Handle(fumoDecryptHandler)
} }