test
This commit is contained in:
parent
0775b445ad
commit
c64c544232
40
workers.go
40
workers.go
@ -257,16 +257,18 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
|
|||||||
}
|
}
|
||||||
_, err := b.Reply(&m, c.Text)
|
_, err := b.Reply(&m, c.Text)
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyMsg")
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyMsg")
|
||||||
case commandReplyDocument:
|
/*
|
||||||
ch := tb.Chat{
|
case commandReplyDocument:
|
||||||
ID: c.FromChatID64,
|
ch := tb.Chat{
|
||||||
}
|
ID: c.FromChatID64,
|
||||||
m := tb.Message{
|
}
|
||||||
ID: int(c.FromMsgID64),
|
m := tb.Message{
|
||||||
Chat: &ch,
|
ID: int(c.FromMsgID64),
|
||||||
}
|
Chat: &ch,
|
||||||
_, err := c.Document.Send(b, m, nil)
|
}
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
|
_, err := c.Document.Send(b, m, nil)
|
||||||
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : ReplyDocument")
|
||||||
|
*/
|
||||||
case commandSendMsg:
|
case commandSendMsg:
|
||||||
if c.ToChatID64 != 0 {
|
if c.ToChatID64 != 0 {
|
||||||
ch := tb.Chat{
|
ch := tb.Chat{
|
||||||
@ -281,14 +283,16 @@ 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:
|
/*
|
||||||
if c.ToChatID64 != 0 {
|
case commandSendDocument:
|
||||||
_, err := c.Document.Send(b, c.ToChatID64, nil)
|
if c.ToChatID64 != 0 {
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
_, err := c.Document.Send(b, c.ToChatID64, nil)
|
||||||
} else if c.ToUserID64 != 0 {
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
||||||
_, err := c.Document.Send(b, c.ToUserID64, nil)
|
} else if c.ToUserID64 != 0 {
|
||||||
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
_, err := c.Document.Send(b, c.ToUserID64, nil)
|
||||||
}
|
logOnError(err, "TGCmdWorker["+strconv.Itoa(id)+"] : SendDocument Chat")
|
||||||
|
}
|
||||||
|
*/
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user