mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-13 02:30:26 +00:00
增加文字转图片&拟声鸟 (#96)
* feat:添加文字转图片,改造长文字 * fix:修改log * fix:修改条件 * fix:不保存图片 * fix:增加block和优先级 * fix:文件夹首字母大写 * fix:修改解签为图片 * feat:添加拟声鸟 * fix:清理缓存 * fix:换一个音频 * fix:小修格式 * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:修一下lint * fix:10s一次 * fix:10s一次 * fix:修lint
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Package chouxianghua 抽象话转化
|
||||
package chouxianghua
|
||||
|
||||
import (
|
||||
@@ -12,7 +13,7 @@ const prio = 10
|
||||
func init() {
|
||||
control.Register("chouxianghua", &control.Options{
|
||||
DisableOnDefault: false,
|
||||
Help: "抽象话\n- 抽象翻译xxx\n",
|
||||
Help: "抽象话\n- 抽象翻译xxx",
|
||||
}).OnRegex("^抽象翻译((\\s|[\\r\\n]|[\\p{Han}\\p{P}A-Za-z0-9])+)$").SetBlock(true).SetPriority(prio).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
r := cx(ctx.State["regex_matched"].([]string)[1])
|
||||
|
||||
@@ -11,7 +11,7 @@ type emoji struct {
|
||||
|
||||
func getPinyinByWord(word string) string {
|
||||
var p pinyin
|
||||
db.Find("pinyin", &p, "where word = '"+word+"'")
|
||||
_ = db.Find("pinyin", &p, "where word = '"+word+"'")
|
||||
return p.Pronun
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ func getPronunByDWord(w0, w1 rune) string {
|
||||
|
||||
func getEmojiByPronun(pronun string) string {
|
||||
var e emoji
|
||||
db.Find("emoji", &e, "where pronunciation = '"+pronun+"'")
|
||||
_ = db.Find("emoji", &e, "where pronunciation = '"+pronun+"'")
|
||||
return e.Emoji
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user