2017-05-06 20:35:31 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2017-04-17 23:58:43 +02:00
|
|
|
|
using Discord;
|
2017-04-25 20:59:38 +02:00
|
|
|
|
using Discord.Commands;
|
2017-05-06 20:35:31 +02:00
|
|
|
|
using Geekbot.net.Lib.IClients;
|
2017-04-17 23:58:43 +02:00
|
|
|
|
|
|
|
|
|
namespace Geekbot.net.Modules
|
|
|
|
|
{
|
|
|
|
|
public class Info : ModuleBase
|
|
|
|
|
{
|
2017-04-19 19:54:29 +02:00
|
|
|
|
private readonly IRedisClient redis;
|
|
|
|
|
public Info(IRedisClient redisClient)
|
|
|
|
|
{
|
|
|
|
|
redis = redisClient;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-25 20:59:38 +02:00
|
|
|
|
[Command("info", RunMode = RunMode.Async), Summary("Get Information about the bot")]
|
|
|
|
|
public async Task BotInfo()
|
2017-04-17 23:58:43 +02:00
|
|
|
|
{
|
|
|
|
|
var eb = new EmbedBuilder();
|
2017-04-21 22:51:30 +02:00
|
|
|
|
|
2017-04-25 20:59:38 +02:00
|
|
|
|
eb.WithTitle("Geekbot V3");
|
2017-04-21 22:51:30 +02:00
|
|
|
|
|
2017-04-25 20:59:38 +02:00
|
|
|
|
var botOwner = Context.Guild.GetUserAsync(ulong.Parse(redis.Client.StringGet("botOwner"))).Result;
|
2017-04-19 19:54:29 +02:00
|
|
|
|
|
2017-04-25 20:59:38 +02:00
|
|
|
|
eb.AddInlineField("Status", Context.Client.ConnectionState.ToString())
|
|
|
|
|
.AddInlineField("Bot Name", Context.Client.CurrentUser.Username)
|
|
|
|
|
.AddInlineField("Bot Owner", $"{botOwner.Username}#{botOwner.Discriminator}");
|
2017-04-21 22:51:30 +02:00
|
|
|
|
|
2017-04-25 20:59:38 +02:00
|
|
|
|
eb.AddInlineField("Servers", Context.Client.GetGuildsAsync().Result.Count);
|
|
|
|
|
|
|
|
|
|
await ReplyAsync("", false, eb.Build());
|
2017-04-21 22:51:30 +02:00
|
|
|
|
}
|
2017-04-17 23:58:43 +02:00
|
|
|
|
}
|
|
|
|
|
}
|