Categories > Coding > C# >

Discord Presence... Actually Tutorial

Posts: 1479

Threads: 95

Joined: Oct, 2019

Reputation: 103

Posted

Hmm I Guess This Is A Tutorial Im Not Gonna Share A Source Rather Say What To Do Btw Im Using Gustas Tutorial On This Cause Why Not Also Im Not A Pro At Explaing Stuff So Don't Complain About Me Trying To Explain

So Right Click Solution

https://cdn.discordapp.com/attachments/704068405019541565/785783949258391552/unknown.png

Go Down To Add

https://cdn.discordapp.com/attachments/704068405019541565/785783996666609664/unknown.png

And Go Down And Click Class And Name It DiscordRpc

https://cdn.discordapp.com/attachments/704068405019541565/785784040544403486/unknown.png

Now Within That Class At The Top Add This As One Of The Using Statements -- using System.Runtime.InteropServices;

In That Class Paste This Code Here In Between The Curly Brackets https://pastebin.com/raw/F0MGQk0W

Now Go Back To Your Main Window And Under Public Partial Class This

https://cdn.discordapp.com/attachments/704068405019541565/785785522013995018/unknown.png

Put The Text Below After The Curly Bracket In Public Partial Class

 

private DiscordRpc.EventHandlers handlers;
private DiscordRpc.RichPresence presence;


Now Under Initialize Component Or In A Window Loaded Event Add This

 

this.handlers = default(DiscordRpc.EventHandlers);
            DiscordRpc.Initialize("Client ID you application", ref this.handlers, true, null);
            this.handlers = default(DiscordRpc.EventHandlers);
            DiscordRpc.Initialize("Client ID you application", ref this.handlers, true, null);
            this.presence.details = "Details RPC";
            this.presence.state = "State RPC";
            this.presence.largeImageKey = "Logo name";
            this.presence.smallImageKey = "Small Logo name";
            this.presence.largeImageText = "Image Text";
            DiscordRpc.UpdatePresence(ref this.presence);

 

Now Go To discordapp.com/developers/applications

And Create A New Application Now In That Application Copy The Client ID And Replace Where It Says "Client ID you application"

With Your Client ID Now On The Presence Go To The Presence Tab Add Some Images And Make The Names Simple If You Want

https://cdn.discordapp.com/attachments/704068405019541565/785786845203922944/unknown.png

https://cdn.discordapp.com/attachments/704068405019541565/785787143158628352/unknown.png

My Image Key ^^

Now In Your C# Replace LargeImageKey With The Image Key You Set For Your Image

Replace The Text Like This

https://cdn.discordapp.com/attachments/704068405019541565/785787191720411146/unknown.png

Now Before Running You Application Go To Where Ever Your App Builds To Probably Debug And Add This Dll There

https://cdn.discordapp.com/attachments/704068405019541565/785788203230953502/discord-rpc-w32.dll

The Large Image Text Is Just The Text Displayed When Hovering On The Image You Can Add A Small Image If You Want

Tbh I Think I Covered Most Of What To Do Details And State Is Just The Text Displayed I Hope I Said Everything Correct But Yes Im Done Could Just Watch Gustas's Video If This Dosen't Help

https://www.youtube.com/watch?v=EHKU_qqdPZg&t=0s

 

Edit: My Fingers Hurt

  • 0

Posts: 870

Threads: 34

Joined: Aug, 2020

Reputation: 6

Replied

nice but why you gotta initilize rpc twice?

  • 0

Posts: 2099

Threads: 10

Joined: Sep, 2020

Reputation: 62

Replied

Stop the cap stack-over-flow winning :troll:

  • 0

Discord : Doctor Doom#0550

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

Can I Know Why Some People Type Like This

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )