stats better, timeout increased
This commit is contained in:
parent
a100afe7d2
commit
f62d9d0d79
@ -48,21 +48,23 @@ namespace NadekoBot
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void LoadStats() {
|
public void LoadStats() {
|
||||||
_statsCache =
|
var sb = new System.Text.StringBuilder();
|
||||||
"`Author: Kwoth`" +
|
sb.AppendLine("`Author: Kwoth`");
|
||||||
//$"\nDiscord.Net version: {DiscordConfig.LibVersion}" +
|
//$"\nDiscord.Net version: {DiscordConfig.LibVersion}" +
|
||||||
//$"\nRuntime: {_client.GetRuntime()}" +
|
//$"\nRuntime: {_client.GetRuntime()}" +
|
||||||
$"\n`Bot Version: {BotVersion}`" +
|
sb.AppendLine($"`Bot Version: {BotVersion}`");
|
||||||
//$"\nLogged in as: {_client.CurrentUser.Name}" +
|
//$"\nLogged in as: {_client.CurrentUser.Name}" +
|
||||||
$"\n`Bot id: {_client.CurrentUser.Id}`" +
|
sb.AppendLine($"`Bot id: {_client.CurrentUser.Id}`");
|
||||||
$"\n`Uptime: {GetUptimeString()}`" +
|
sb.AppendLine($"`Owner id: {NadekoBot.OwnerID}`");
|
||||||
$"\n`Servers: {_client.Servers.Count()}`" +
|
sb.AppendLine($"`Uptime: {GetUptimeString()}`");
|
||||||
$"\n`Channels: {_client.Servers.Sum(s => s.AllChannels.Count())}`" +
|
sb.Append($"`Servers: {_client.Servers.Count()}");
|
||||||
|
sb.AppendLine($" | Channels: {_client.Servers.Sum(s => s.AllChannels.Count())}`");
|
||||||
//$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" +
|
//$"\nUsers: {_client.Servers.SelectMany(x => x.Users.Select(y => y.Id)).Count()} (non-unique)" +
|
||||||
$"\n`Heap: {Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString()} MB`" +
|
sb.AppendLine($"`Heap: {Math.Round((double)GC.GetTotalMemory(true) / 1.MiB(), 2).ToString()} MB`");
|
||||||
$"\n`Commands Ran this session: {_commandsRan}`" +
|
sb.AppendLine($"`Commands Ran this session: {_commandsRan}`");
|
||||||
$"\n`Message queue size:{_client.MessageQueue.Count}`" +
|
sb.AppendLine($"`Message queue size:{_client.MessageQueue.Count}`");
|
||||||
$"\n`Greeted/Byed {Commands.ServerGreetCommand.Greeted} times.`";
|
sb.AppendLine($"`Greeted {Commands.ServerGreetCommand.Greeted} times.`");
|
||||||
|
_statsCache = sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetStats() {
|
public string GetStats() {
|
||||||
|
@ -385,7 +385,7 @@ namespace NadekoBot.Modules {
|
|||||||
.Description("Shows some basic stats for nadeko")
|
.Description("Shows some basic stats for nadeko")
|
||||||
.Do(async e => {
|
.Do(async e => {
|
||||||
var t = Task.Run(() => {
|
var t = Task.Run(() => {
|
||||||
return NadekoStats.Instance.GetStats() + "\n`" + Music.GetMusicStats() + "`";
|
return NadekoStats.Instance.GetStats() + "`" + Music.GetMusicStats() + "`";
|
||||||
});
|
});
|
||||||
|
|
||||||
await e.Send(await t);
|
await e.Send(await t);
|
||||||
|
@ -62,7 +62,8 @@ namespace NadekoBot {
|
|||||||
|
|
||||||
//create new discord client
|
//create new discord client
|
||||||
client = new DiscordClient(new DiscordConfigBuilder() {
|
client = new DiscordClient(new DiscordConfigBuilder() {
|
||||||
MessageCacheSize = 0
|
MessageCacheSize = 0,
|
||||||
|
ConnectionTimeout = 60000,
|
||||||
});
|
});
|
||||||
|
|
||||||
//create a command service
|
//create a command service
|
||||||
|
Loading…
Reference in New Issue
Block a user