This repository was archived by the owner on Jan 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDiscordRPC.cs
More file actions
41 lines (36 loc) · 1.33 KB
/
DiscordRPC.cs
File metadata and controls
41 lines (36 loc) · 1.33 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
using DiscordRPC;
namespace ProSwapperLobby
{
public class DiscordRPC
{
public static DiscordRpcClient client = new DiscordRpcClient("697579712653819985");
public static void InitializeRPC()
{
if (client.IsInitialized)
return;
client.Initialize();
Button[] buttons = { new Button() { Label = "Discord", Url = Services.MainService.DiscordWidgetAPI.instant_invite }, new Button() { Label = "YouTube", Url = "https://youtube.com/proswapperofficial" } };
client.SetPresence(new RichPresence()
{
Details = "Pro Swapper Lobby | " + Services.MainService.version,
State = "Idle",
Timestamps = Timestamps.Now,
Buttons = buttons,
Assets = new Assets()
{
LargeImageKey = "logotransparent",
LargeImageText = "Pro Swapper",
SmallImageKey = "proswapperman",
SmallImageText = "Made by Kye#5000"
}
});
SetState("Idle");
}
public static void SetState(string state, bool watching = false)
{
if (watching)
state = "Watching " + state;
client.UpdateState(state);
}
}
}