1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-10 04:50:27 +08:00

add more log

This commit is contained in:
源文雨
2022-07-07 15:18:31 +08:00
parent 1645369ed3
commit 4e50c08da3
4 changed files with 18 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ func (tc *TelegramClient) processEvent(update tgba.Update) {
matcherLock.RUnlock()
continue
}
log.Println("pass", tp, "event to plugins")
log.Debugln("pass", tp, "event to plugins")
matchers := make([]*Matcher, n)
copy(matchers, matcherMap[tp])
matcherLock.RUnlock()
@@ -53,8 +53,10 @@ func (tc *TelegramClient) processEvent(update tgba.Update) {
switch tp {
case "Message":
ctx.Message = (*tgba.Message)(f.UnsafePointer())
log.Println("receive Message Text:", ctx.Message.Text)
case "CallbackQuery":
ctx.Message = (*tgba.CallbackQuery)(f.UnsafePointer()).Message
log.Println("receive CallbackQuery Data:", (*tgba.CallbackQuery)(f.UnsafePointer()).Data)
}
go match(ctx, matchers)
continue