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:
parent
806746925e
commit
c1179888d5
3 changed files with 8 additions and 9 deletions
|
@ -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") },
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
namespace Boyfriend.Data;
|
||||
|
||||
public enum NotificationReceiver {
|
||||
Interested,
|
||||
Role
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue