This commit is contained in:
shoopea 2019-06-09 15:58:08 +08:00
parent 5ddf475be4
commit ae00d64a92

View File

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