internal void KillSession(GoLiveDelete goLive)
        {
            var key = new StreamKey(goLive.StreamKey);

            if (OnLeftLivestream != null)
            {
                Task.Run(() => OnLeftLivestream.Invoke(this, new LivestreamDisconnectEventArgs(key.UserId, goLive)));
            }
        }
        internal LivestreamDisconnectEventArgs(ulong streamerId, GoLiveDelete goLive)
        {
            StreamerId = streamerId;

            RawReason = goLive.RawReason;

            if (Enum.TryParse(RawReason.Replace("_", ""), true, out DiscordLivestreamError err))
            {
                Reason = err;
            }
            else
            {
                Reason = DiscordLivestreamError.Unknown;
            }
        }
示例#3
0
 internal void Disconnect(GoLiveDelete delete)
 {
     base.Disconnect((ushort)UnorthodoxCloseCode.KeepQuiet, "Disconnecting with Go Live error");
     OnDisconnected?.Invoke(this, new DiscordGoLiveCloseEventArgs(DiscordMediaCloseCode.Disconnected, "Disconnected from livestream: " + delete.Reason, delete));
 }
示例#4
0
 internal DiscordGoLiveException(GoLiveDelete delete) : base($"Failed to connect to Go Live. Error: {delete.Reason}")
 {
     Error    = delete.Reason;
     RawError = delete.RawReason;
 }