update
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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}}})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user