Fix failing test.

This commit is contained in:
Ilja Lapkovskis 2024-01-20 16:51:34 +02:00
parent 5e497cfcba
commit e41be9f718
No known key found for this signature in database
GPG key ID: 53D2AA4F0D1079C4

View file

@ -688,11 +688,13 @@ func TestDeleteMessage(t *testing.T) {
} }
func TestPinChatMessage(t *testing.T) { func TestPinChatMessage(t *testing.T) {
bot, _ := getBot(t) bot, err := getBot(t)
require.NoError(t, err)
msg := tgbotapi.NewMessage(SupergroupChatID, "A test message from the test library in telegram-bot-api") msg := tgbotapi.NewMessage(SupergroupChatID, "A test message from the test library in telegram-bot-api")
msg.ParseMode = tgbotapi.ModeMarkdown msg.ParseMode = tgbotapi.ModeMarkdown
message, _ := bot.Send(msg) message, err := bot.Send(msg)
require.NoError(t, err)
pinChatMessageConfig := tgbotapi.PinChatMessageConfig{ pinChatMessageConfig := tgbotapi.PinChatMessageConfig{
BaseChatMessage: tgbotapi.BaseChatMessage{ BaseChatMessage: tgbotapi.BaseChatMessage{
@ -703,11 +705,9 @@ func TestPinChatMessage(t *testing.T) {
}, },
DisableNotification: false, DisableNotification: false,
} }
_, err := bot.Request(pinChatMessageConfig) res, err := bot.Request(pinChatMessageConfig)
require.NoError(t, err)
if err != nil { require.NotNil(t, res)
t.Error(err)
}
} }
func TestUnpinChatMessage(t *testing.T) { func TestUnpinChatMessage(t *testing.T) {