Closed DeathlyBower959 closed 3 years ago
Framework: Im new, no clue
For "Framework", i wanted to know if this is a console application, in Unity3D, monogame etc etc. Basically what you are using to make this. If its a console application i need to know if you are using .NET Framework 4.7 or .NET Core 2 (that is determined when you are creating the project).
Version: Wot
This is the version of the nuget package you are using. Only applicable if you are using a non-unity framework.
The issue
You dont actually set your rich presences to have any buttons.
new DiscordRPC.Button() { Label = "Test", Url = "https://test" };
is creating the button, but you are immediately throwing it away by doing nothing with it.
You need to set the Buttons
property in the RichPresence
object you create when you go to SetPresence
, as per The Example.
The example didn't work, there are 2 errors. I used the example and it just shows those errors, is there something im doing wrong?
'Button' is an ambiguous reference between 'DiscordRPC.Button' and 'System.Windows.Forms.Button'
'Button' is an ambiguous reference between 'DiscordRPC.Button' and 'System.Windows.Forms.Button'
MY NEW CODE
public void Initialize()
{
if (Properties.Ventile.Default.RpcE == true) {
client = new DiscordRpcClient("832806990953840710");
Thread.Sleep(100);
client.Initialize();
//Set the rich presence
//Call this as many times as you want and anywhere in your code.\
client.SetPresence(new RichPresence()
{
Details = "Idling In Launcher...",
State = Properties.Ventile.Default.LineRPC,
Timestamps = new Timestamps()
{
Start = DateTime.UtcNow.AddSeconds(1)
},
Assets = new Assets()
{
LargeImageKey = "logo",
LargeImageText = Properties.Ventile.Default.Version,
},
Buttons = new Button[]
{
new Button() { Label = "Fish", Url = "https://lachee.dev/" }
}
});
}
}
Wait im sorry, I just got it, it needed to be DiscordRPC.Button instead of Button Im new to Visual Studio 2019, so im learning as I go, sorry to bother you.
Im not sure why you have a Thread.Sleep
, that isn't required
I have It there, because sometimes there are lag spikes, so I added a cooldown to enable disable rpm, and if I put delays around, it doesnt lag as much
I have my public void named initialize, with the stuff inside, but the buttons dont work
I expect a button to show up on the rich presence
Desktop (please complete the following information):
MY CODE All variables in here are defined, the main problem is with the new DiscordRPC.button thing and client.SetPresence