Use ApplicationId for interactions (#2044)

This commit is contained in:
Quin Lynch
2022-01-15 05:44:55 -04:00
committed by GitHub
parent 7f4feea96d
commit c6825647f2
5 changed files with 50 additions and 26 deletions

View File

@@ -0,0 +1,18 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Discord.API.Gateway
{
internal class PartialApplication
{
[JsonProperty("id")]
public ulong Id { get; set; }
[JsonProperty("flags")]
public ApplicationFlags Flags { get; set; }
}
}

View File

@@ -28,6 +28,8 @@ namespace Discord.API.Gateway
public Channel[] PrivateChannels { get; set; }
[JsonProperty("relationships")]
public Relationship[] Relationships { get; set; }
[JsonProperty("application")]
public PartialApplication Application { get; set; }
//Ignored
/*[JsonProperty("user_settings")]

View File

@@ -870,6 +870,7 @@ namespace Discord.WebSocket
var activities = _activity.IsSpecified ? ImmutableList.Create(_activity.Value) : null;
currentUser.Presence = new SocketPresence(Status, null, activities);
ApiClient.CurrentUserId = currentUser.Id;
ApiClient.CurrentApplicationId = data.Application.Id;
Rest.CurrentUser = RestSelfUser.Create(this, data.User);
int unavailableGuilds = 0;
for (int i = 0; i < data.Guilds.Length; i++)