Browse Source

fix: guild scheduled events update (#1976)

tags/3.1.0
Quin Lynch GitHub 3 years ago
parent
commit
8daa0b6c91
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.WebSocket/DiscordSocketClient.cs
  2. +2
    -0
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs

+ 1
- 1
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -2640,7 +2640,7 @@ namespace Discord.WebSocket
return;
}

var before = guild.GetEvent(data.Id);
var before = guild.GetEvent(data.Id)?.Clone();

var beforeCacheable = new Cacheable<SocketGuildEvent, ulong>(before, data.Id, before != null, () => Task.FromResult((SocketGuildEvent)null));



+ 2
- 0
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuildEvent.cs View File

@@ -196,6 +196,8 @@ namespace Discord.WebSocket
public IAsyncEnumerable<IReadOnlyCollection<RestUser>> GetUsersAsync(ulong fromUserId, Direction dir, int limit = DiscordConfig.MaxGuildEventUsersPerBatch, RequestOptions options = null)
=> GuildHelper.GetEventUsersAsync(Discord, this, fromUserId, dir, limit, options);

internal SocketGuildEvent Clone() => MemberwiseClone() as SocketGuildEvent;

#region IGuildScheduledEvent

/// <inheritdoc/>


Loading…
Cancel
Save