Removed unneeded httpclient for searchimages and some minor cleanup

This commit is contained in:
Kwoth
2022-03-21 13:33:43 +01:00
parent aab5bc9744
commit 4cf3bdb53a
2 changed files with 15 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
#nullable disable
#nullable disable
using Humanizer.Localisation;
using NadekoBot.Common.ModuleBehaviors;
using System.Diagnostics;
@@ -133,11 +133,16 @@ public class StatsService : IStatsService, IReadyExecutor, INService, IDisposabl
};
}
public async Task OnReadyAsync()
private void InitializeChannelCount()
{
var guilds = _client.Guilds;
textChannels = guilds.Sum(g => g.Channels.Count(cx => cx is ITextChannel));
voiceChannels = guilds.Sum(g => g.Channels.Count(cx => cx is IVoiceChannel));
textChannels = guilds.Sum(static g => g.Channels.Count(static cx => cx is ITextChannel));
voiceChannels = guilds.Sum(static g => g.Channels.Count(static cx => cx is IVoiceChannel));
}
public async Task OnReadyAsync()
{
InitializeChannelCount();
using var timer = new PeriodicTimer(TimeSpan.FromHours(1));
do