This commit is contained in:
shoopea 2019-06-09 00:58:31 +08:00
parent 0775b445ad
commit c64c544232

View File

@ -257,16 +257,18 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
}
_, err := b.Reply(&m, c.Text)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyMsg")
case commandReplyDocument:
ch := tb.Chat{
ID: c.FromChatID64,
}
m := tb.Message{
ID: int(c.FromMsgID64),
Chat: &ch,
}
_, err := c.Document.Send(b, m, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
/*
case commandReplyDocument:
ch := tb.Chat{
ID: c.FromChatID64,
}
m := tb.Message{
ID: int(c.FromMsgID64),
Chat: &ch,
}
_, err := c.Document.Send(b, m, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
*/
case commandSendMsg:
if c.ToChatID64 != 0 {
ch := tb.Chat{
@ -281,14 +283,16 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
_, err := b.Send(&ch, c.Text)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendMsg User")
}
case commandSendDocument:
if c.ToChatID64 != 0 {
_, err := c.Document.Send(b, c.ToChatID64, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
} else if c.ToUserID64 != 0 {
_, err := c.Document.Send(b, c.ToUserID64, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
}
/*
case commandSendDocument:
if c.ToChatID64 != 0 {
_, err := c.Document.Send(b, c.ToChatID64, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
} else if c.ToUserID64 != 0 {
_, err := c.Document.Send(b, c.ToUserID64, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
}
*/
default:
}