fix: ApiClient.CurrentUser being null (#1864)
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Discord.Rest
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the logged-in user.
|
/// Gets the logged-in user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public new RestSelfUser CurrentUser => base.CurrentUser as RestSelfUser;
|
public new RestSelfUser CurrentUser { get => base.CurrentUser as RestSelfUser; internal set => base.CurrentUser = value; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DiscordRestClient() : this(new DiscordRestConfig()) { }
|
public DiscordRestClient() : this(new DiscordRestConfig()) { }
|
||||||
|
|||||||
@@ -618,6 +618,7 @@ namespace Discord.WebSocket
|
|||||||
var activities = _activity.IsSpecified ? ImmutableList.Create(_activity.Value) : null;
|
var activities = _activity.IsSpecified ? ImmutableList.Create(_activity.Value) : null;
|
||||||
currentUser.Presence = new SocketPresence(Status, null, activities);
|
currentUser.Presence = new SocketPresence(Status, null, activities);
|
||||||
ApiClient.CurrentUserId = currentUser.Id;
|
ApiClient.CurrentUserId = currentUser.Id;
|
||||||
|
Rest.CurrentUser = RestSelfUser.Create(this, data.User);
|
||||||
int unavailableGuilds = 0;
|
int unavailableGuilds = 0;
|
||||||
for (int i = 0; i < data.Guilds.Length; i++)
|
for (int i = 0; i < data.Guilds.Length; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user