46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using ChaosBot.Discord.PreConditions;
|
|
using ChaosBot.Repositories;
|
|
using Discord;
|
|
using Discord.Commands;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace ChaosBot.Discord.Modules.User
|
|
{
|
|
public class Info : ModuleBase
|
|
{
|
|
[Command("info")]
|
|
[Alias("version")]
|
|
[CheckCommandPerm("User")]
|
|
public async Task ShowInfo()
|
|
{
|
|
try
|
|
{
|
|
var sb = new StringBuilder();
|
|
var embed = new EmbedBuilder();
|
|
Configuration config = new Configuration();
|
|
|
|
embed.WithColor(new Color(255, 255, 0));
|
|
embed.Title = $"Information {config.GetValue<string>("Bot:Name")} v{config.GetValue<string>("Bot:Version")}";
|
|
sb.AppendLine($"Prefix: {config.GetValue("Discord:Prefix", default(string), Context.Guild.Id)}");
|
|
|
|
/*
|
|
* Add the string to the Embed
|
|
*/
|
|
embed.Description = sb.ToString();
|
|
|
|
/*
|
|
* Reply with the Embed created above
|
|
*/
|
|
await ReplyAsync(null, false, embed.Build());
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
LoggingFacade.Exception(ex);
|
|
}
|
|
}
|
|
}
|
|
}
|