[Fix] Certain global user properies not getting updated (#3158)
* yep * fix
This commit is contained in:
50
.gitignore
vendored
50
.gitignore
vendored
@@ -206,3 +206,53 @@ docs/api/\.manifest
|
||||
|
||||
# Codealike UID
|
||||
codealike.json
|
||||
WebhookEventsApp/WebhookEventsApp.csproj
|
||||
WebhookEventsApp/Properties/launchSettings.json
|
||||
WebhookEventsApp/Program.cs
|
||||
WebhookEventsApp/Modules/TestModule.cs
|
||||
WebhookEventsApp/Interaction.cs
|
||||
WebhookEventsApp/AspNetCoreInteractions.cs
|
||||
WebhookEventsApp/appsettings.json
|
||||
WebhookEventsApp/appsettings.Development.json
|
||||
VoiceFuckery/VoiceFuckery.csproj
|
||||
VoiceFuckery/Program.cs
|
||||
VoiceFuckery/opus.dll
|
||||
VoiceFuckery/libsodium.dll
|
||||
VoiceFuckery/bees.mp3
|
||||
ShardFuckery/ShardFuckery.csproj
|
||||
ShardFuckery/Program.cs
|
||||
RestInteractionsTestBot/RestInteractionsTestBot.csproj
|
||||
RestInteractionsTestBot/Properties/launchSettings.json
|
||||
RestInteractionsTestBot/Program.cs
|
||||
RestInteractionsTestBot/Modules/TestModule.cs
|
||||
RestInteractionsTestBot/BotService.cs
|
||||
RestInteractionsTestBot/AspNetCoreInteractions.cs
|
||||
RestInteractionsTestBot/appsettings.json
|
||||
RestInteractionsTestBot/appsettings.Development.json
|
||||
DNetTestApp/Program.cs
|
||||
DNetTestApp/DNetTestApp.csproj
|
||||
DNetRestIntFramework/Program.cs
|
||||
DNetRestIntFramework/DNetRestIntFramework.csproj
|
||||
DNetRestIntFramework/BotService.cs
|
||||
DiscordNetTestBot/Startup.cs
|
||||
DiscordNetTestBot/Properties/CommandLocalizations.ru.resx
|
||||
DiscordNetTestBot/Properties/CommandLocalizations.resx
|
||||
DiscordNetTestBot/Properties/CommandLocalizations.Designer.cs
|
||||
DiscordNetTestBot/Modules/TestModule.cs
|
||||
DiscordNetTestBot/Modules/MoreModules.cs
|
||||
DiscordNetTestBot/Modules/CringeAutocomplete.cs
|
||||
DiscordNetTestBot/Modules/CommandModule.cs
|
||||
DiscordNetTestBot/Modules/AnotherModule.cs
|
||||
DiscordNetTestBot/InteractionHandler.cs
|
||||
DiscordNetTestBot/DiscordNetTestBot.csproj
|
||||
DiscordNetTestBot/DiscordBot.cs
|
||||
DiscordNetTestBot/appsettings.json
|
||||
DiscordNetTestBot/DiscordNetTemplate.csproj
|
||||
DiscordNetTestBot/Services/DiscordBotService.cs
|
||||
DiscordNetTestBot/Services/InteractionHandler.cs
|
||||
DiscordNetTestBot/Modules/ModalValueDebug.cs
|
||||
DiscordNetTestBot/Modules/ComponentsDebug.cs
|
||||
ShardedFun/ShardedFun.csproj
|
||||
ShardedFun/Program.cs
|
||||
DiscordNetTestBot/Services/TetrisService.cs
|
||||
DiscordNetTestBot/Modules/TetrisModule.cs
|
||||
|
||||
@@ -8,14 +8,27 @@ namespace Discord.WebSocket
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
internal class SocketGlobalUser : SocketUser
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override bool IsBot { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string Username { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override ushort DiscriminatorValue { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string AvatarId { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
internal override SocketPresence Presence { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsWebhook => false;
|
||||
/// <inheritdoc />
|
||||
internal override SocketGlobalUser GlobalUser { get => this; set => throw new NotImplementedException(); }
|
||||
|
||||
private readonly object _lockObj = new object();
|
||||
|
||||
@@ -31,6 +31,28 @@ namespace Discord.WebSocket
|
||||
public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } }
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get { return GlobalUser.GlobalName; } internal set { GlobalUser.GlobalName = value; } }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationHash;
|
||||
internal set => GlobalUser.AvatarDecorationHash = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationSkuId;
|
||||
internal set => GlobalUser.AvatarDecorationSkuId = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild
|
||||
{
|
||||
get => GlobalUser.PrimaryGuild;
|
||||
internal set => GlobalUser.PrimaryGuild = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } }
|
||||
|
||||
|
||||
@@ -53,6 +53,13 @@ namespace Discord.WebSocket
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get { return GlobalUser.GlobalName; } internal set { GlobalUser.GlobalName = value; } }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash { get => GlobalUser.AvatarDecorationHash; internal set => GlobalUser.AvatarDecorationHash = value; }
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId { get => GlobalUser.AvatarDecorationSkuId; internal set => GlobalUser.AvatarDecorationSkuId = value; }
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild { get => GlobalUser.PrimaryGuild; internal set => GlobalUser.PrimaryGuild = value; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string GuildBannerHash { get; private set; }
|
||||
|
||||
|
||||
@@ -46,6 +46,28 @@ namespace Discord.WebSocket
|
||||
public override string AvatarId { get { return GlobalUser.AvatarId; } internal set { GlobalUser.AvatarId = value; } }
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get { return GlobalUser.GlobalName; } internal set { GlobalUser.GlobalName = value; } }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationHash;
|
||||
internal set => GlobalUser.AvatarDecorationHash = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationSkuId;
|
||||
internal set => GlobalUser.AvatarDecorationSkuId = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild
|
||||
{
|
||||
get => GlobalUser.PrimaryGuild;
|
||||
internal set => GlobalUser.PrimaryGuild = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
internal override SocketPresence Presence { get { return GlobalUser.Presence; } set { GlobalUser.Presence = value; } }
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -65,6 +65,28 @@ namespace Discord.WebSocket
|
||||
get => GlobalUser.GlobalName;
|
||||
internal set => GlobalUser.GlobalName = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationHash;
|
||||
internal set => GlobalUser.AvatarDecorationHash = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId
|
||||
{
|
||||
get => GlobalUser.AvatarDecorationSkuId;
|
||||
internal set => GlobalUser.AvatarDecorationSkuId = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild
|
||||
{
|
||||
get => GlobalUser.PrimaryGuild;
|
||||
internal set => GlobalUser.PrimaryGuild = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string DisplayAvatarId => GuildAvatarId ?? AvatarId;
|
||||
|
||||
|
||||
@@ -21,6 +21,12 @@ namespace Discord.WebSocket
|
||||
public override string AvatarId { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId { get; internal set; }
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsBot { get; internal set; }
|
||||
|
||||
@@ -49,10 +49,13 @@ namespace Discord.WebSocket
|
||||
public IReadOnlyCollection<IActivity> Activities => Presence.Activities ?? ImmutableList<IActivity>.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string AvatarDecorationHash { get; private set; }
|
||||
public abstract string AvatarDecorationHash { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ulong? AvatarDecorationSkuId { get; private set; }
|
||||
public abstract ulong? AvatarDecorationSkuId { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract PrimaryGuild? PrimaryGuild { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public PrimaryGuild? PrimaryGuild { get; private set; }
|
||||
@@ -120,9 +123,9 @@ namespace Discord.WebSocket
|
||||
{
|
||||
if (model.PrimaryGuild.Value is null)
|
||||
{
|
||||
PrimaryGuild = null;
|
||||
if (PrimaryGuild is not null)
|
||||
hasChanges = true;
|
||||
PrimaryGuild = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,15 @@ namespace Discord.WebSocket
|
||||
/// <inheritdoc />
|
||||
public override string GlobalName { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string AvatarDecorationHash { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ulong? AvatarDecorationSkuId { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override PrimaryGuild? PrimaryGuild { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsBot { get; internal set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user