diff --git a/types_test.go b/types_test.go index d2c24d4..ed8d625 100644 --- a/types_test.go +++ b/types_test.go @@ -34,6 +34,7 @@ func TestMessageTime(t *testing.T) { func TestMessageIsCommandWithCommand(t *testing.T) { message := tgbotapi.Message{Text: "/command"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.IsCommand() != true { t.Fail() @@ -58,6 +59,7 @@ func TestIsCommandWithEmptyText(t *testing.T) { func TestCommandWithCommand(t *testing.T) { message := tgbotapi.Message{Text: "/command"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.Command() != "command" { t.Fail() @@ -82,6 +84,7 @@ func TestCommandWithNonCommand(t *testing.T) { func TestCommandWithBotName(t *testing.T) { message := tgbotapi.Message{Text: "/command@testbot"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 16}} if message.Command() != "command" { t.Fail() @@ -90,6 +93,7 @@ func TestCommandWithBotName(t *testing.T) { func TestMessageCommandArgumentsWithArguments(t *testing.T) { message := tgbotapi.Message{Text: "/command with arguments"} + message.Entities = &[]tgbotapi.MessageEntity{{Type: "bot_command", Offset: 0, Length: 8}} if message.CommandArguments() != "with arguments" { t.Fail() }