feat: add msg name
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package tgbot
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -30,7 +31,7 @@ func Run(sendFunc func(string) error) {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
conf.Bot.Debug = true
|
||||
conf.Bot.Debug = false
|
||||
|
||||
log.Printf("Authorized on account %s", conf.Bot.Self.UserName)
|
||||
|
||||
@@ -43,7 +44,9 @@ func Run(sendFunc func(string) error) {
|
||||
logrus.Infof("[%s] %s", update.Message.From.UserName, update.Message.Text)
|
||||
if update.Message.Command() == "talk" {
|
||||
logrus.Infof("id is %d", update.Message.Chat.ID)
|
||||
sendFunc(update.Message.CommandArguments())
|
||||
m := fmt.Sprintf("%v: %v", update.Message.From.UserName, update.Message.CommandArguments())
|
||||
err := sendFunc(m)
|
||||
logrus.WithError(err).Error("send message error")
|
||||
}
|
||||
if update.Message.Command() == "list" {
|
||||
logrus.Infof("id is %d", update.Message.Chat.ID)
|
||||
|
Reference in New Issue
Block a user