From f36c0db78b9a604cb168a66ae2150c24edc81eaf Mon Sep 17 00:00:00 2001 From: c0re100 Date: Sun, 6 Feb 2022 11:25:46 +0800 Subject: [PATCH] Add one more example for command args --- example/command/ReplyCommand.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/example/command/ReplyCommand.go b/example/command/ReplyCommand.go index 39ab138..595d2fa 100644 --- a/example/command/ReplyCommand.go +++ b/example/command/ReplyCommand.go @@ -107,6 +107,18 @@ func main() { continue } log.Printf("Message sent, ID: %d", m.Id) + case "/repeat": + m, err := client.SendMessage(&tdlib.SendMessageRequest{ + ChatId: chatId, + ReplyToMessageId: msgId, + InputMessageContent: &tdlib.InputMessageText{ + Text: &tdlib.FormattedText{Text: tdlib.CommandArgument(msgText)}, + }, + }) + if err != nil { + continue + } + log.Printf("Message sent, ID: %d", m.Id) } } }