feat: send personal player notifications
Deploy Telegram Bot / build-and-push (push) Successful in 3m36s
Deploy Telegram Bot / deploy (push) Successful in 11s

This commit is contained in:
2026-04-27 10:11:11 +03:00
parent 3228e77c7f
commit a8f2b10956
23 changed files with 666 additions and 38 deletions
@@ -0,0 +1,33 @@
namespace GmRelay.Shared.Domain;
public enum SessionNotificationMode
{
GroupAndDirect,
GroupOnly
}
public static class SessionNotificationModeExtensions
{
public const string GroupAndDirectValue = nameof(SessionNotificationMode.GroupAndDirect);
public const string GroupOnlyValue = nameof(SessionNotificationMode.GroupOnly);
public static bool ShouldSendDirectMessages(this SessionNotificationMode mode) =>
mode == SessionNotificationMode.GroupAndDirect;
public static string ToDatabaseValue(this SessionNotificationMode mode) =>
mode switch
{
SessionNotificationMode.GroupAndDirect => GroupAndDirectValue,
SessionNotificationMode.GroupOnly => GroupOnlyValue,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, "Unknown notification mode.")
};
public static SessionNotificationMode FromDatabaseValue(string? value) =>
value switch
{
null or "" => SessionNotificationMode.GroupAndDirect,
GroupAndDirectValue => SessionNotificationMode.GroupAndDirect,
GroupOnlyValue => SessionNotificationMode.GroupOnly,
_ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown notification mode.")
};
}