Пример #1
0
 /// <summary>Use this method to get the current list of the bot's commands for the given scope and user language.</summary>
 /// <param name="bot">BotClient</param>
 /// <param name="scope">A <see cref="BotCommandScope"/> object, describing scope of users. Defaults to <see cref="BotCommandScopeDefault"/>.</param>
 /// <param name="languageCode">A two-letter ISO 639-1 language code or an empty string.</param>
 /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
 /// <exception cref="BotRequestException">Thrown when a request to Telegram Bot API got an error response.</exception>
 /// <exception cref="ArgumentNullException">Thrown when a required parameter is null.</exception>
 /// <returns>Array of <see cref="BotCommand"/> on success. If commands aren't set, an empty list is returned.</returns>
 public static async Task <BotCommand[]> GetMyCommandsAsync(this BotClient bot, [Optional] BotCommandScope scope, [Optional] string languageCode, [Optional] CancellationToken cancellationToken) => await bot.GetMyCommandsAsync <BotCommand[]>(scope, languageCode, cancellationToken);
Пример #2
0
 /// <summary>Use this method to get the current list of the bot's commands for the given scope and user language.</summary>
 /// <param name="bot">BotClient</param>
 /// <param name="args">Parameters.</param>
 /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
 /// <exception cref="BotRequestException">Thrown when a request to Telegram Bot API got an error response.</exception>
 /// <exception cref="ArgumentNullException">Thrown when a required parameter is null.</exception>
 /// <returns>Array of <see cref="BotCommand"/> on success. If commands aren't set, an empty list is returned. on success. If commands aren't set, an empty list is returned.</returns>
 public static async Task <BotCommand[]> GetMyCommandsAsync(this BotClient bot, GetMyCommandsArgs args, [Optional] CancellationToken cancellationToken) => await bot.GetMyCommandsAsync <BotCommand[]>(args, cancellationToken);