-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPresenceMessage.cs
More file actions
49 lines (44 loc) · 1.35 KB
/
PresenceMessage.cs
File metadata and controls
49 lines (44 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace DiscordRPC.Message
{
/// <summary>
/// Representation of the message received by discord when the presence has been updated.
/// </summary>
public class PresenceMessage : IMessage
{
/// <summary>
/// The type of message received from discord
/// </summary>
public override MessageType Type
{ get { return MessageType.PresenceUpdate; } }
internal PresenceMessage() : this(null)
{
}
internal PresenceMessage(RichPresenceResponse rpr)
{
if (rpr == null)
{
Presence = null;
Name = "No Rich Presence";
ApplicationID = "";
}
else
{
Presence = (RichPresence)rpr;
Name = rpr.Name;
ApplicationID = rpr.ClientID;
}
}
/// <summary>
/// The rich presence Discord has set
/// </summary>
public RichPresence Presence { get; internal set; }
/// <summary>
/// The name of the application Discord has set it for
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// The ID of the application discord has set it for
/// </summary>
public string ApplicationID { get; internal set; }
}
}