- Using PeriodicTimer in a few places instead of Timer

- Some small refactorings
- Fixed reference to non-existent command in bot.yml
This commit is contained in:
Kwoth
2022-01-05 08:00:25 +01:00
parent f13d7d2c80
commit 6c39044435
10 changed files with 114 additions and 111 deletions

View File

@@ -243,8 +243,8 @@ public partial class Administration
var allShardStrings = statuses.Select(st =>
{
var stateStr = ConnectionStateToEmoji(st);
var timeDiff = DateTime.UtcNow - st.LastUpdate;
var stateStr = ConnectionStateToEmoji(st);
var maxGuildCountLength =
statuses.Max(x => x.GuildCount).ToString().Length;
return $"`{stateStr} "
@@ -272,9 +272,9 @@ public partial class Administration
var timeDiff = DateTime.UtcNow - status.LastUpdate;
return status.ConnectionState switch
{
ConnectionState.Connected => "✅",
ConnectionState.Disconnected => "🔻",
_ when timeDiff > TimeSpan.FromSeconds(30) => " ❗ ",
ConnectionState.Connected => "✅",
_ => " ⏳"
};
}