mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 23:30:20 +00:00
feat:添加抽象话插件 (#92)
This commit is contained in:
20
plugin_chouxianghua/model.go
Normal file
20
plugin_chouxianghua/model.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package chouxianghua
|
||||
|
||||
type Pinyin struct {
|
||||
Word string `db:"word"`
|
||||
Pronunciation string `db:"pronunciation"`
|
||||
}
|
||||
type Emoji struct {
|
||||
Pronunciation string `db:"pronunciation"`
|
||||
Emoji string `db:"emoji"`
|
||||
}
|
||||
|
||||
func getPronunciationByWord(word string) (p Pinyin) {
|
||||
db.Find("pinyin", &p, "where word = '"+word+"'")
|
||||
return
|
||||
}
|
||||
|
||||
func getEmojiByPronunciation(pronunciation string) (e Emoji) {
|
||||
db.Find("emoji", &e, "where pronunciation = '"+pronunciation+"'")
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user