Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN: Empty frame was read. Please send report to Lachee. #89

Open
TheRealAyCe opened this issue Jun 18, 2020 · 0 comments
Open

WARN: Empty frame was read. Please send report to Lachee. #89

TheRealAyCe opened this issue Jun 18, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@TheRealAyCe
Copy link

TheRealAyCe commented Jun 18, 2020

Your API told me to send a report.

I started more or less the demo code in a WPF app.


#nullable enable

using DiscordRPC;
using DiscordRPC.Logging;
using System;
using System.Threading.Tasks;

namespace DiscordCommunication
{
	public class DiscordService : IDisposable
	{
		private readonly DiscordRpcClient _client;

		public DiscordService()
		{
			_client = new DiscordRpcClient(
				"...",
				-1,
				new ConsoleLogger() { Level = LogLevel.Warning },
				false
			);

			//Subscribe to events
			_client.OnReady += (sender, e) =>
			{
				Console.WriteLine("Received Ready from user {0}", e.User.Username);
			};

			_client.OnPresenceUpdate += (sender, e) =>
			{
				Console.WriteLine("Received Update! {0}", e.Presence);
			};

			//Connect to the RPC
			_client.Initialize();

			//Set the rich presence
			//Call this as many times as you want and anywhere in your code.
			_client.SetPresence(new RichPresence()
			{
				Details = "Example Project",
				State = "csharp example",
				Assets = new Assets()
				{
					LargeImageKey = "x",
					LargeImageText = "x",
					SmallImageKey = "x"
				}
			});

			Loop();
		}

		private async void Loop()
		{
			try
			{
				while (!_client.IsDisposed)
				{
					_client.Invoke();
					await Task.Delay(1000);
				}
			}
			catch (Exception e)
			{
				Console.WriteLine($"OUCH: {e}");
			}
		}

		public void Dispose()
		{
			_client.Dispose();
		}
	}
}

Then I left the app running and exited Discord.

@TheRealAyCe TheRealAyCe added the bug Something isn't working label Jun 18, 2020
@Lachee Lachee added this to Needs triage in Weekend Bug Fix Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Weekend Bug Fix
  
Needs triage
Development

No branches or pull requests

1 participant