增加文字转图片&拟声鸟 (#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:
himawari
2022-01-03 00:26:00 +08:00
committed by GitHub
parent a69d985139
commit 045ee091a7
21 changed files with 497 additions and 193 deletions

View File

@@ -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])

View File

@@ -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
}