Skip to content
This repository was archived by the owner on Sep 29, 2020. It is now read-only.

Commit 1b2c498

Browse files
committed
Improve recovery for disconnections
1 parent 4c3d58f commit 1b2c498

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

IRC-Relay/IRC.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public IRC(dynamic config, Session session)
5050
AutoRejoinOnKick = true
5151
};
5252

53-
ircClient.OnConnected += OnConnected;
54-
ircClient.OnError += this.OnError;
53+
ircClient.OnConnected += this.OnConnected;
54+
ircClient.OnDisconnected += this.OnDisconnected;
5555
ircClient.OnChannelMessage += this.OnChannelMessage;
5656
}
5757

@@ -85,13 +85,13 @@ private void OnConnected(object sender, EventArgs e)
8585
Discord.Log(new LogMessage(LogSeverity.Critical, "IRCSpawn", "IRC bot initalized."));
8686
}
8787

88-
private void OnError(object sender, ErrorEventArgs e)
88+
private void OnDisconnected(object sender, EventArgs e)
8989
{
9090
/* Create a new thread to kill the session. We cannot block
9191
* this Disconnect call */
9292
new Thread(async() => await session.Kill(Session.TargetBot.Both)).Start();
9393

94-
Discord.Log(new LogMessage(LogSeverity.Critical, "IRCOnError", e.ErrorMessage));
94+
Discord.Log(new LogMessage(LogSeverity.Critical, "IRCOnError", "Irc Disconnected"));
9595
}
9696

9797
private void OnChannelMessage(object sender, IrcEventArgs e)

0 commit comments

Comments
 (0)