This commit is contained in:
cdle
2021-09-16 21:33:22 +08:00
parent df47e94e58
commit 7731289fab
3 changed files with 15 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
package core
var Pushs = map[string]func(int, string){}
func Push(class string, uid int, content string) {
if push, ok := Pushs[class]; ok {
push(uid, content)
}
}
+3
View File
@@ -215,4 +215,7 @@ func init() {
bot.Client.OnSelfPrivateMessage(onPrivateMessage)
bot.Client.OnGroupMessage(OnGroupMessage)
bot.Client.OnSelfGroupMessage(OnGroupMessage)
core.Pushs["qq"] = func(i int, s string) {
bot.SendPrivateMessage(int64(i), int64(qq.GetInt("groupCode")), &message.SendingMessage{Elements: []message.IMessageElement{&message.TextElement{Content: s}}})
}
}
+3
View File
@@ -43,6 +43,9 @@ func init() {
b.Handle(tb.OnText, Handler)
logs.Info("监听telegram机器人")
b.Start()
core.Pushs["qq"] = func(i int, s string) {
b.Send(&tb.User{ID: i}, s)
}
}
func (sender *Sender) GetContent() string {