-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiscord.cs
More file actions
52 lines (47 loc) · 1.44 KB
/
Discord.cs
File metadata and controls
52 lines (47 loc) · 1.44 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
50
51
52
using DiscordRPC;
namespace QwertyClicker
{
public partial class Discord
{
public string ?client_id;
public DiscordRpcClient ?RPC;
public Discord(string client_id)
{
this.client_id = client_id;
}
public void Start()
{
try
{
this.RPC = new DiscordRpcClient(this.client_id);
RPC.Initialize();
RPC.SetPresence(new RichPresence()
{
Details = "QwertyClicker",
State = "Autoclicking...",
Assets = new Assets()
{
LargeImageKey = "qwerty_logo",
LargeImageText = "Qwerty Development",
SmallImageKey = "qwerty_clicker_logo",
SmallImageText = "QwertyClicker",
}
});
Logger.info("Started: Discord Rich Presence!");
} catch
{
Logger.error("Unable to start discord rich presence... Possible discord is not opened or connection problems...");
}
}
public void Stop()
{
if (this.RPC != null)
{
RPC.Invoke();
} else
{
Logger.error("Unable to stop discord rich presence: DiscordRPC is not initilized yet.");
}
}
}
}