justdmitry / NetTelegramBotApi

C# client library for building Telegram bot
MIT License
74 stars 28 forks source link

Ensure keyboard markup removal #55

Closed poulad closed 7 years ago

poulad commented 7 years ago

This edition ensures keyboard markup removal when ReplyKeyboardRemove type is used in the request by setting a default value so the usage will be changed from:

await Bot.MakeRequestAsync(new SendMessage(update.Message.Chat.Id, "Test")
{
  ReplyToMessageId = update.Message.MessageId,
  ReplyMarkup = new ReplyKeyboardRemove { RemoveKeyboard = true },
});

to:

await Bot.MakeRequestAsync(new SendMessage(update.Message.Chat.Id, "Test")
{
  ReplyToMessageId = update.Message.MessageId,
  ReplyMarkup = new ReplyKeyboardRemove(), // no need to set any values
});