This commit is contained in:
shoopea 2019-06-09 14:50:04 +08:00
parent c64c544232
commit 55564b6c56

View File

@ -283,16 +283,21 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
_, err := b.Send(&ch, c.Text) _, err := b.Send(&ch, c.Text)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendMsg User") logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendMsg User")
} }
/* case commandSendDocument:
case commandSendDocument: if c.ToChatID64 != 0 {
if c.ToChatID64 != 0 { ch := tb.Chat{
_, err := c.Document.Send(b, c.ToChatID64, nil) ID: c.ToUserID64,
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat") }
} else if c.ToUserID64 != 0 { _, err := c.Document.Send(b, ch, nil)
_, err := c.Document.Send(b, c.ToUserID64, nil) logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat") } else if c.ToUserID64 != 0 {
} ch := tb.Chat{
*/ ID: c.ToUserID64,
}
_, err := c.Document.Send(b, &ch, nil)
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
}
default: default:
} }