RoboZhando/Extensions/EmbedExtensions.cs
/// <summary>
/// Turns the command into a embeded response
/// </summary>
/// <param name="ctx"></param>
/// <param name="title"></param>
/// <param name="color"></param>
/// <returns></returns>
Turns the command into a embeded response
Turns the command into a embeded response
public static DiscordEmbedBuilder ToEmbed(this CommandContext ctx, string title = null, DiscordColor? color = null)
        {
            if (title == null) title = ctx.Command.Name + " Response";
            if (title.Length > 1)
            {
                var c = title[0];
                title = c.ToString().ToUpperInvariant() + title.Substring(1);
            }
            return new DiscordEmbedBuilder()
                .WithFooter("Response to " + ctx.User.Username, AvatarAPI + ctx.User.Id)
                .WithAuthor(title, iconUrl: IncludeBotAvatar ? AvatarAPI + ctx.Client.CurrentUser.Id : null)
                .WithColor(color.GetValueOrDefault(DefaultColour))
                .WithTimestamp(DateTime.UtcNow);
        }
public static DiscordEmbedBuilder ToEmbed ( this CommandContext ctx , string title = null , DiscordColor ? color = null ) { if ( title == null ) title = ctx . Command . Name + " " ; if ( title . Length > 1 ) { var c = title [ 0 ] ; title = c . ToString ( ) . ToUpperInvariant ( ) + title . Substring ( 1 ) ; } return new DiscordEmbedBuilder ( ) . WithFooter ( " " + ctx . User . Username , AvatarAPI + ctx . User . Id ) . WithAuthor ( title , iconUrl : IncludeBotAvatar ? AvatarAPI + ctx . Client . CurrentUser . Id : null ) . WithColor ( color . GetValueOrDefault ( DefaultColour ) ) . WithTimestamp ( DateTime . UtcNow ) ; }
Turns the command into a embeded response
Turns the command into a embeded response
None
CommandContext
this
title
string
None
color
DiscordColor?
None
ctx
None