|
|
|
@ -12,8 +12,8 @@ import ( |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
|
TestToken = "153667468:AAHlSHlMqSt1f_uFmVRJbm5gntu2HI4WW8I" |
|
|
|
|
ChatID = 76918703 |
|
|
|
|
TestToken = "378975008:AAHqfRjhWiCGrxI4zJP8O5dpfdxUH3ezhxQ" |
|
|
|
|
ChatID = 41507975 |
|
|
|
|
ReplyToMessageID = 35 |
|
|
|
|
ExistingPhotoFileID = "AgADAgADw6cxG4zHKAkr42N7RwEN3IFShCoABHQwXEtVks4EH2wBAAEC" |
|
|
|
|
ExistingDocumentFileID = "BQADAgADOQADjMcoCcioX1GrDvp3Ag" |
|
|
|
@ -422,12 +422,17 @@ func TestSendChatConfig(t *testing.T) { |
|
|
|
|
func TestSendEditMessage(t *testing.T) { |
|
|
|
|
bot, _ := getBot(t) |
|
|
|
|
|
|
|
|
|
msg, err := bot.Send(tgbotapi.NewMessage(ChatID, "Testing editing.")) |
|
|
|
|
testMsg := tgbotapi.NewMessage(ChatID, "Testing editing.") |
|
|
|
|
testBtn := tgbotapi.NewInlineKeyboardButtonData("Test", "testdata") |
|
|
|
|
testMsg.ReplyMarkup = tgbotapi.NewInlineKeyboardMarkup(tgbotapi.NewInlineKeyboardRow(testBtn)) |
|
|
|
|
|
|
|
|
|
msg, err := bot.Send(testMsg) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Error(err) |
|
|
|
|
t.Fail() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Keyboard should be removed here!
|
|
|
|
|
edit := tgbotapi.EditMessageTextConfig{ |
|
|
|
|
BaseEdit: tgbotapi.BaseEdit{ |
|
|
|
|
ChatID: ChatID, |
|
|
|
@ -443,6 +448,27 @@ func TestSendEditMessage(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestSendDeleteMessage(t *testing.T) { |
|
|
|
|
bot, _ := getBot(t) |
|
|
|
|
|
|
|
|
|
msg, err := bot.Send(tgbotapi.NewMessage(ChatID, "Testing deleting.")) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Error(err) |
|
|
|
|
t.Fail() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
delete := tgbotapi.DeleteMessageConfig{ |
|
|
|
|
ChatID: ChatID, |
|
|
|
|
MessageID: msg.MessageID, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_, err = bot.Send(delete) |
|
|
|
|
if err != nil { |
|
|
|
|
t.Error(err) |
|
|
|
|
t.Fail() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestGetUserProfilePhotos(t *testing.T) { |
|
|
|
|
bot, _ := getBot(t) |
|
|
|
|
|
|
|
|
|