feat(bot): implement deleteMessage method
This commit is contained in:
parent
79b26b07c5
commit
bdb0f1f4c5
3 changed files with 50 additions and 0 deletions
19
bot_test.go
19
bot_test.go
|
@ -590,3 +590,22 @@ func ExampleAnswerInlineQuery() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeleteMessage(t *testing.T) {
|
||||
bot, _ := getBot(t)
|
||||
|
||||
msg := tgbotapi.NewMessage(ChatID, "A test message from the test library in telegram-bot-api")
|
||||
msg.ParseMode = "markdown"
|
||||
message, _ := bot.Send(msg)
|
||||
|
||||
deleteMessageConfig := tgbotapi.DeleteMessageConfig{
|
||||
ChatID: message.Chat.ID,
|
||||
MessageID: message.MessageID,
|
||||
}
|
||||
_, err := bot.DeleteMessage(deleteMessageConfig)
|
||||
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue