@@ -26,20 +26,6 @@ public static async Task Watch(DiscordClient client)
26
26
do
27
27
{
28
28
await Task . Delay ( Config . SocketDisconnectCheckIntervalInSec , Config . Cts . Token ) . ConfigureAwait ( false ) ;
29
- foreach ( var sudoer in ModProvider . Mods . Values . Where ( m => m . Sudoer ) )
30
- {
31
- var user = await client . GetUserAsync ( sudoer . DiscordId ) . ConfigureAwait ( false ) ;
32
- if ( user ? . Presence ? . Activity ? . CustomStatus ? . Name is string cmd && cmd . StartsWith ( "restart" ) )
33
- {
34
- var instance = cmd . Split ( ' ' , StringSplitOptions . RemoveEmptyEntries ) . LastOrDefault ( ) ;
35
- if ( ulong . TryParse ( instance , out var botId ) && botId == client . CurrentUser . Id )
36
- {
37
- Config . Log . Warn ( $ "Found request to restart on { user . Username } #{ user . Discriminator } 's custom status") ;
38
- Sudo . Bot . Restart ( Program . InvalidChannelId , $ "Restarted by request from { user . Username } #{ user . Discriminator } 's custom status") ;
39
- }
40
- }
41
- }
42
-
43
29
if ( IsOk )
44
30
continue ;
45
31
@@ -89,12 +75,8 @@ public static void OnLogHandler(string level, string message)
89
75
}
90
76
else if ( level == nameof ( LogLevel . Fatal ) )
91
77
{
92
- if ( message . Contains ( "Connection closed (-1, '')" ) )
93
- {
94
- Config . Log . Warn ( "Potential dangling socket, restarting…" ) ;
95
- Sudo . Bot . Restart ( Program . InvalidChannelId , $@ "Restarted to reset potential dangling socket") ;
96
- }
97
- if ( message . Contains ( "Socket connection terminated" )
78
+ if ( message . Contains ( "Connection closed (-1, '')" )
79
+ || message . Contains ( "Socket connection terminated" )
98
80
|| message . Contains ( "heartbeats were skipped. Issuing reconnect." ) )
99
81
DisconnectTimestamps . Enqueue ( DateTime . UtcNow ) ;
100
82
}
0 commit comments