chore: cleanup

This commit is contained in:
2025-07-25 16:37:42 +03:00
parent 7ceb8f656e
commit b15a77557e
28 changed files with 224 additions and 198 deletions

View File

@@ -1,7 +1,7 @@
namespace JOBot.TClient.Infrastructure.Attributes.Authorization;
/// <summary>
///Атрибут допуска к команде пользователя не завершившего стадию PrepareUser
/// Атрибут допуска к команде пользователя не завершившего стадию PrepareUser
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public class AcceptNotPreparedAttribute : Attribute;

View File

@@ -4,14 +4,14 @@ using Telegram.Bot.Types;
namespace JOBot.TClient.Infrastructure.Exceptions;
/// <summary>
/// Exception for fallback
/// WARNING: Don't create new exception without throwing it
/// Exception for fallback
/// WARNING: Don't create new exception without throwing it
/// </summary>
public class FallbackException : Exception
{
public FallbackException(string message, Message botMessage, ITelegramBotClient botClient) : base(message)
{
botClient.SendMessage(chatId: botMessage.Chat.Id,
botClient.SendMessage(botMessage.Chat.Id,
TextResource.FallbackMessage);
}
}

View File

@@ -4,6 +4,9 @@ namespace JOBot.TClient.Infrastructure.Extensions;
public static class GRpcModelsExtensions
{
public static bool IsPrepared(this GetUserResponse user) => user is { Eula: true, IsLogged: true } &&
!string.IsNullOrEmpty(user.CVUrl);
public static bool IsPrepared(this GetUserResponse user)
{
return user is { Eula: true, IsLogged: true } &&
!string.IsNullOrEmpty(user.CVUrl);
}
}