mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
part 3 of the response rework
This commit is contained in:
@@ -40,13 +40,4 @@ public abstract class AnyContext
|
||||
/// <param name="args">Arguments (if any) to format in</param>
|
||||
/// <returns>A formatted localized string</returns>
|
||||
public abstract string GetText(string key, object[]? args = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a context-aware <see cref="IEmbedBuilder"/> instance
|
||||
/// (future feature for guild-based embed colors)
|
||||
/// Any code dealing with embeds should use it for future-proofness
|
||||
/// instead of manually creating embedbuilder instances
|
||||
/// </summary>
|
||||
/// <returns>A context-aware <see cref="IEmbedBuilder"/> instance </returns>
|
||||
public abstract EmbedBuilder Embed();
|
||||
}
|
@@ -14,13 +14,13 @@
|
||||
//
|
||||
// // unlocalized
|
||||
// public static Task<IUserMessage> SendConfirmAsync(this IMessageChannel ch, AnyContext ctx, string msg)
|
||||
// => ch.EmbedAsync(ctx.Embed().WithOkColor().WithDescription(msg));
|
||||
// => _sender.Response(ch).Embed(ctx.Embed().WithOkColor().WithDescription(msg)).SendAsync();
|
||||
//
|
||||
// public static Task<IUserMessage> SendPendingAsync(this IMessageChannel ch, AnyContext ctx, string msg)
|
||||
// => ch.EmbedAsync(ctx.Embed().WithPendingColor().WithDescription(msg));
|
||||
// => _sender.Response(ch).Embed(ctx.Embed().WithPendingColor().WithDescription(msg)).SendAsync();
|
||||
//
|
||||
// public static Task<IUserMessage> SendErrorAsync(this IMessageChannel ch, AnyContext ctx, string msg)
|
||||
// => ch.EmbedAsync(ctx.Embed().WithErrorColor().WithDescription(msg));
|
||||
// => _sender.Response(ch).Embed(ctx.Embed().WithErrorColor().WithDescription(msg)).SendAsync();
|
||||
//
|
||||
// // unlocalized
|
||||
// public static Task<IUserMessage> SendConfirmAsync(this AnyContext ctx, string msg)
|
||||
|
@@ -1,18 +0,0 @@
|
||||
using Discord;
|
||||
|
||||
namespace NadekoBot;
|
||||
|
||||
public interface IEmbedBuilder
|
||||
{
|
||||
EmbedBuilder WithDescription(string? desc);
|
||||
EmbedBuilder WithTitle(string? title);
|
||||
EmbedBuilder AddField(string title, object value, bool isInline = false);
|
||||
EmbedBuilder WithFooter(string text, string? iconUrl = null);
|
||||
EmbedBuilder WithAuthor(string name, string? iconUrl = null, string? url = null);
|
||||
EmbedBuilder WithColor(EmbedColor color);
|
||||
EmbedBuilder WithDiscordColor(Color color);
|
||||
Embed Build();
|
||||
EmbedBuilder WithUrl(string url);
|
||||
EmbedBuilder WithImageUrl(string url);
|
||||
EmbedBuilder WithThumbnailUrl(string url);
|
||||
}
|
Reference in New Issue
Block a user