JOBot/JOBot.TClient/Commands/IAuthorizedTelegramCommand.cs
2025-07-25 16:37:42 +03:00

18 lines
632 B
C#

using JOBot.Proto;
using Telegram.Bot.Types;
namespace JOBot.TClient.Commands;
public interface IAuthorizedTelegramCommand : ITelegramCommand
{
/// <exception cref="UnauthorizedAccessException">
/// Throws if you try to use ITelegramCommand.ExecuteAsync
/// instead of IAuthorizedTelegramCommand.ExecuteAsync
/// </exception>
Task ITelegramCommand.ExecuteAsync(Update update, CancellationToken ct)
{
throw new UnauthorizedAccessException("You do not have permission to access this command.");
}
public Task ExecuteAsync(Update update, GetUserResponse user, CancellationToken ct);
}