Open Freakyygg opened 4 years ago
"doesn't work" isnt an issue. Its a symptom. Please provide error messages or displayed behaviour so I can debug this faster.
Additionally, please enable the logging of the client and set to Info or Trace. Log out the messages when you are trying to set the presence and share here. This will show if the presence is actually being set via discord.
Lastly, please give the framework (mono, .net fx w/ winfom, .net core etc) as well as the package version of discord-rpc-csharp so I can rule out any platform specific issues.
I see you have gone against my issue guidelines. Please follow the format provided when creating new issues in the future.
Hello,
I'm experiencing the same issue when using it with Unity 2019.2.11f1, scripting backend is Mono with .NET 4.x
Package version is latest stable 1.0.150
As for the behaviour and logs, it behaves the same both in the Editor and with a debug build. In which it works just fine for the first presence update and then gets stuck on a message enqueue. After the final enqueue message it wouldn't react to any update I'm trying to push and nothing is logged either.
I've attached the logs, this was with log level trace.
Thank you for the logs. I will investigate this over the weekend and hopefully update the Unity package (its fairly out of date actually).
I will comment back here when done so be sure to watch this thread :)
It's not repaired yet (at least for Visual Studio NuGet). Please update it
EDIT: Is there any other way you can update the presence?
It's not repaired yet (at least for Visual Studio NuGet). Please update it
EDIT: Is there any other way you can update the presence?
There shouldn't be any issue with the visual studio version. This bug is only for the Unity Editor.
Well... no, it does not work with SetPresence() on Visual Studio (Unless I am an idiot :D). And I have 2 more questions: Is there any way or are yuo planning to add time stampt (I mean the timer)? Is there any way or are yuo planning to add player count (I mean the thing that shows ex. 1 of 5)?
EDIT: now I know how to make timer
Well... no, it does not work with SetPresence() on Visual Studio (Unless I am an idiot :D). And I have 2 more questions: Is there any way or are yuo planning to add time stampt (I mean the timer)? Is there any way or are yuo planning to add player count (I mean the thing that shows ex. 1 of 5)?
EDIT: now I know how to make timer
1: Please make a proper bug report. I will not respond to "it no work". 2: No, there are timestamp data structures already (you seem to have found them) 3: Player count already exists, you need to set the Party. The fields are Size and Max.
Well... no, it does not work with SetPresence() on Visual Studio (Unless I am an idiot :D). And I have 2 more questions: Is there any way or are yuo planning to add time stampt (I mean the timer)? Is there any way or are yuo planning to add player count (I mean the thing that shows ex. 1 of 5)?
EDIT: now I know how to make timer
It does work. Please reread your code and see if its actually correct, just used the example code on the main page, It does work. Maybe you didnt add your application id to "client = new DiscordRpcClient("");" ?
Send your code maybe you just made a little mistake.
Thanks, and sorry for before. Here is my code:
public void Initialize()
{
client = new DiscordRpcClient(textBox1.Text);
client.OnReady += (sender, e) =>
{
//richTextBox1.AppendText("Received Ready from user " + e.User.Username);
Console.WriteLine("User {0}", e.User.Username);
};
client.OnPresenceUpdate += (sender, e) =>
{
//richTextBox1.AppendText("Received Update! {0}" + e.Presence);
Console.WriteLine("Update! {0}", e.Presence);
};
client.Initialize();
client.SetPresence(new RichPresence()
{
Details = textBox2.Text,
State = textBox3.Text,
Assets = new Assets()
{
LargeImageKey = "large",
LargeImageText = "Download from: juzio520.webd.pro/youtubeviewer"
//SmallImageKey = "image_small"
},
Timestamps = new Timestamps()
{
Start = DateTime.UtcNow
},
Party = new Party()
{
Size = 1,
Max = 10
}
});
}
client = new DiscordRpcClient(textBox1.Text);
Why are you doing a textbox? Multiple users? Different Application id's? Could you explain that? also please fix the code tag ;)
I'm using textBox becouse I am making a program that let's you easly set your presence (I know that such already exists but it's fun to make one for your own), so user have to set his/her application ID
And I don't know what happend with the code tag :( If I make any gramatical errors, I'm sorry but I'm polish
EDIT: And my code for party doesn't work either
Your code works ;) you forgot the ID part of the party. The ID part can be whatever you want it to be.
Ok, I repaired party but really? When I call Initialize() function (by clicking a button) it still does not update it. Am I really an idiot?
Ok, I repaired party but really? When I call Initialize() function (by clicking a button) it still does not update it. Am I really an idiot?
Please set up the logger to trace and give the supplied logs.
Ok, I repaired party but really? When I call Initialize() function (by clicking a button) it still does not update it. Am I really an idiot?
Please set up the logger to trace and give the supplied logs.
I can't. When I do this it gives me an error
"Gives me an error" isn't useful. please provide logs and the actual error its throwing.
Like I mentioned before, I do not help with "it doesnt work" sort of statements because they are uninformative and are annoying to try to deduce how it "doesn't work". If you would like reasonable answers / help from me then I need logs and error messages. Ideally I would have snippets of code that were throwing the errors too (which I assume you already shared :) )
What youre doing is, Creating a new rpcclient and when you click the button again you want to create another one which doenst work obviously.
To update the text and all call just that
client.SetPresence(new RichPresence()
{
Details = textBox2.Text,
State = textBox3.Text,
Assets = new Assets()
{
LargeImageKey = "large",
LargeImageText = "Download from: juzio520.webd.pro/youtubeviewer"
//SmallImageKey = "image_small"
},
Timestamps = new Timestamps()
{
Start = DateTime.UtcNow
},
Party = new Party()
{
Size = 1,
ID = "";
Max = 10
}
});
So you should create just another button or handle it differently
Ok, thanks for all, and sorry
Oh and going back to Logger problem: I just didn't added the using DiscordRPC.Logging line on the top One more time: thanks for help and sorry for the mess :D
Hey,
So at the init of my form I am calling all the needed functions to get the RPC which works perfectly. After some time on a click event of a button I want to update the RPC but this doesn't work :/
I also tried the
client.UpdateState("Test");
for example, this deons't work either.Here is my current code to update the RPC:
client.SetPresence(new RichPresence() { Details = "Playing against ", State = EnemyTeamName, Assets = new Assets() { LargeImageKey = "1000x1000", LargeImageText = "Opportunity League"//, //SmallImageKey = "image_small", //SmallImageText = "Test" }, Timestamps = new Timestamps() { Start = DateTime.UtcNow } });
Hopefully you can help me Best Regards