Fancy Colors in embeds :D

This commit is contained in:
dboerlage 2017-04-19 19:54:29 +02:00
parent 4db152f304
commit 9ff2e7cdc0
No known key found for this signature in database
GPG key ID: BDA07B7D3FCF147F
3 changed files with 15 additions and 6 deletions

View file

@ -2,19 +2,27 @@
using System.Threading.Tasks;
using Discord.Commands;
using Discord;
using Geekbot.net.Lib;
namespace Geekbot.net.Modules
{
public class Info : ModuleBase
{
private readonly IRedisClient redis;
public Info(IRedisClient redisClient)
{
redis = redisClient;
}
[Command("info"), Summary("Show some info about the bot.")]
public async Task getInfo()
{
var eb = new EmbedBuilder();
eb.WithAuthor(new EmbedAuthorBuilder()
.WithIconUrl(Context.User.GetAvatarUrl())
.WithName(Context.User.Username));
eb.AddField("Test", "Some testing stuff here...");
eb.WithTitle("Geekbot Information");
eb.WithColor(new Color(110, 204, 147));
eb.AddInlineField("Version", "3.1")
.AddInlineField("Uptime", "Not Calculated...");
await ReplyAsync("", false, eb.Build());
}
}

View file

@ -30,7 +30,8 @@ namespace Geekbot.net.Modules
eb.WithAuthor(new EmbedAuthorBuilder()
.WithIconUrl(userInfo.GetAvatarUrl())
.WithName(userInfo.Username));
eb.WithColor(new Color(221, 255, 119));
eb.AddField("Discordian Since", $"{userInfo.CreatedAt.Day}/{userInfo.CreatedAt.Month}/{userInfo.CreatedAt.Year} ({age} days)");
eb.AddInlineField("Level", level)
.AddInlineField("Messages Sent", messages);

View file

@ -114,7 +114,7 @@ namespace Geekbot.net
{
var message = messsageParam;
if (message == null) return;
if (message.Author.Username.Equals(client.CurrentUser.Username)) return;
// if (message.Author.Username.Equals(client.CurrentUser.Username)) return;
var channel = (SocketGuildChannel)message.Channel;