Synchronize events only on sch. event updates (#131)
This PR moves all code related to synchronization of scheduled events to ScheduledEventUpdateService. Just like #130, this reduces possible points of failures, maintenance burden and reliance on gateway events
This commit is contained in:
parent
d713b977f0
commit
e073c5a572
3 changed files with 14 additions and 50 deletions
|
@ -50,19 +50,6 @@ public class GuildLoadedResponder : IResponder<IGuildCreate>
|
|||
data.GetOrCreateMemberData(member.User.Value.ID);
|
||||
}
|
||||
|
||||
foreach (var schEvent in guild.GuildScheduledEvents)
|
||||
{
|
||||
if (!data.ScheduledEvents.TryGetValue(schEvent.ID.Value, out var eventData))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
eventData.Name = schEvent.Name;
|
||||
eventData.ScheduledStartTime = schEvent.ScheduledStartTime;
|
||||
eventData.ScheduleOnStatusUpdated = eventData.Status != schEvent.Status;
|
||||
eventData.Status = schEvent.Status;
|
||||
}
|
||||
|
||||
if (!GuildSettings.ReceiveStartupMessages.Get(cfg))
|
||||
{
|
||||
return Result.FromSuccess();
|
||||
|
|
Reference in a new issue