2017-09-14 22:11:19 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Discord;
|
|
|
|
|
using Discord.Commands;
|
|
|
|
|
using StackExchange.Redis;
|
|
|
|
|
|
|
|
|
|
namespace Geekbot.net.Modules
|
|
|
|
|
{
|
|
|
|
|
public class Info : ModuleBase
|
|
|
|
|
{
|
|
|
|
|
private readonly IDatabase redis;
|
2017-09-15 22:56:03 +02:00
|
|
|
|
|
2017-09-14 22:11:19 +02:00
|
|
|
|
public Info(IDatabase redis)
|
|
|
|
|
{
|
|
|
|
|
this.redis = redis;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-15 22:56:03 +02:00
|
|
|
|
[Command("info", RunMode = RunMode.Async)]
|
|
|
|
|
[Summary("Get Information about the bot")]
|
2017-09-14 22:11:19 +02:00
|
|
|
|
public async Task BotInfo()
|
|
|
|
|
{
|
|
|
|
|
var eb = new EmbedBuilder();
|
|
|
|
|
|
2017-09-27 22:48:09 +02:00
|
|
|
|
eb.WithTitle("Geekbot V3.2");
|
2017-09-14 22:11:19 +02:00
|
|
|
|
|
|
|
|
|
var botOwner = Context.Guild.GetUserAsync(ulong.Parse(redis.StringGet("botOwner"))).Result;
|
|
|
|
|
|
|
|
|
|
eb.AddInlineField("Status", Context.Client.ConnectionState.ToString())
|
|
|
|
|
.AddInlineField("Bot Name", Context.Client.CurrentUser.Username)
|
|
|
|
|
.AddInlineField("Bot Owner", $"{botOwner.Username}#{botOwner.Discriminator}");
|
|
|
|
|
|
|
|
|
|
eb.AddInlineField("Servers", Context.Client.GetGuildsAsync().Result.Count);
|
|
|
|
|
|
|
|
|
|
await ReplyAsync("", false, eb.Build());
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-17 23:58:43 +02:00
|
|
|
|
}
|