1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Move NotificationReceiver into GuildConfiguration

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2023-06-04 18:58:23 +05:00
parent 806746925e
commit c1179888d5
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
3 changed files with 8 additions and 9 deletions

View file

@ -3,6 +3,11 @@ using System.Globalization;
namespace Boyfriend.Data;
public class GuildConfiguration {
public enum NotificationReceiver {
Interested,
Role
}
public static readonly Dictionary<string, CultureInfo> CultureInfoCache = new() {
{ "en", new CultureInfo("en-US") },
{ "ru", new CultureInfo("ru-RU") },

View file

@ -1,6 +0,0 @@
namespace Boyfriend.Data;
public enum NotificationReceiver {
Interested,
Role
}

View file

@ -401,9 +401,9 @@ public class GuildScheduledEventUpdateResponder : IResponder<IGuildScheduledEven
gatewayEvent.GuildID, gatewayEvent.ID, withMember: true, ct: ct);
if (!usersResult.IsDefined(out var users)) return Result.FromError(usersResult);
if (receivers.Contains(NotificationReceiver.Role) && role.Value is not 0)
if (receivers.Contains(GuildConfiguration.NotificationReceiver.Role) && role.Value is not 0)
content.Append($"{Mention.Role(role)} ");
if (receivers.Contains(NotificationReceiver.Interested))
if (receivers.Contains(GuildConfiguration.NotificationReceiver.Interested))
content = users.Where(
user => {
if (!user.GuildMember.IsDefined(out var member)) return true;
@ -423,7 +423,7 @@ public class GuildScheduledEventUpdateResponder : IResponder<IGuildScheduledEven
Messages.EventDuration,
DateTimeOffset.UtcNow.Subtract(
guildData.ScheduledEvents[gatewayEvent.ID.Value].ActualStartTime
?? gatewayEvent.ScheduledStartTime)))
?? gatewayEvent.ScheduledStartTime).ToString()))
.WithColour(Color.Black);
guildData.ScheduledEvents.Remove(gatewayEvent.ID.Value);