test
This commit is contained in:
parent
205cf0598d
commit
968d7ae958
4
bot.go
4
bot.go
@ -219,7 +219,9 @@ func botMsgExportAll(m *tb.Message) {
|
|||||||
TGCmdQueue <- c
|
TGCmdQueue <- c
|
||||||
}
|
}
|
||||||
|
|
||||||
d := tb.Document{File: tb.FromReader(bytes.NewReader(b))}
|
d := tb.Document{}
|
||||||
|
d.File = tb.FromReader(bytes.NewReader(b))
|
||||||
|
d.FileName = `backup.zip`
|
||||||
|
|
||||||
c = TGCommand{
|
c = TGCommand{
|
||||||
Type: commandReplyDocument,
|
Type: commandReplyDocument,
|
||||||
|
12
workers.go
12
workers.go
@ -265,7 +265,7 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
|
|||||||
ID: int(c.FromMsgID64),
|
ID: int(c.FromMsgID64),
|
||||||
Chat: &ch,
|
Chat: &ch,
|
||||||
}
|
}
|
||||||
_, err := b.Reply(&m, c.Document)
|
_, err := c.Document.Send(b, &m)
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
|
||||||
case commandSendMsg:
|
case commandSendMsg:
|
||||||
if c.ToChatID64 != 0 {
|
if c.ToChatID64 != 0 {
|
||||||
@ -283,16 +283,10 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
|
|||||||
}
|
}
|
||||||
case commandSendDocument:
|
case commandSendDocument:
|
||||||
if c.ToChatID64 != 0 {
|
if c.ToChatID64 != 0 {
|
||||||
ch := tb.Chat{
|
_, err := c.Document.Send(b, c.ToChatID64)
|
||||||
ID: c.ToChatID64,
|
|
||||||
}
|
|
||||||
_, err := b.Send(&ch, c.Document)
|
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
||||||
} else if c.ToUserID64 != 0 {
|
} else if c.ToUserID64 != 0 {
|
||||||
ch := tb.Chat{
|
_, err := c.Document.Send(b, c.ToUserID64)
|
||||||
ID: c.ToUserID64,
|
|
||||||
}
|
|
||||||
_, err := b.Send(&ch, c.Document)
|
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user