Update MessageClient.cs

- increasing parameters for Get/SetCommand methods
- adding DeleteBotCommands methods
This commit is contained in:
FlorianDahn 2022-05-15 23:17:01 +02:00
parent e81f535f75
commit 2c567419ec

View File

@ -159,27 +159,35 @@ namespace TelegramBotBase.Base
/// This will return the current list of bot commands. /// This will return the current list of bot commands.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public async Task<BotCommand[]> GetBotCommands() public async Task<BotCommand[]> GetBotCommands(BotCommandScope scope = null, String languageCode = null)
{ {
return await this.TelegramClient.GetMyCommandsAsync(); return await this.TelegramClient.GetMyCommandsAsync(scope, languageCode);
} }
/// <summary> /// <summary>
/// This will set your bot commands to the given list. /// This will set your bot commands to the given list.
/// </summary> /// </summary>
/// <param name="botcommands"></param> /// <param name="botcommands"></param>
/// <returns></returns> /// <returns></returns>
public async Task SetBotCommands(List<BotCommand> botcommands) public async Task SetBotCommands(List<BotCommand> botcommands, BotCommandScope scope = null, String languageCode = null)
{ {
await this.TelegramClient.SetMyCommandsAsync(botcommands); await this.TelegramClient.SetMyCommandsAsync(botcommands, scope, languageCode);
} }
/// <summary>
/// This will delete the current list of bot commands.
/// </summary>
/// <returns></returns>
public async Task DeleteBotCommands(BotCommandScope scope = null, String languageCode = null)
{
await this.TelegramClient.DeleteMyCommandsAsync(scope, languageCode);
}
#region "Events" #region "Events"
public event Async.AsyncEventHandler<UpdateResult> MessageLoop public event Async.AsyncEventHandler<UpdateResult> MessageLoop
{ {