- Reworked embed builder

- Use IEmbedBuilderService to create embed builders
- Wrapped embed builder and using IEmbedBuilder
This commit is contained in:
Kwoth
2021-07-09 22:23:19 +02:00
parent 5b4daa9dd3
commit 5e4754fa40
103 changed files with 730 additions and 540 deletions

View File

@@ -29,7 +29,7 @@ namespace NadekoBot.Modules.Utility
var ch = (ITextChannel)ctx.Channel;
var invite = await ch.CreateInviteAsync(opts.Expire, opts.MaxUses, isTemporary: opts.Temporary, isUnique: opts.Unique).ConfigureAwait(false);
await ctx.Channel.SendConfirmAsync($"{ctx.User.Mention} https://discord.gg/{invite.Code}").ConfigureAwait(false);
await SendConfirmAsync($"{ctx.User.Mention} https://discord.gg/{invite.Code}").ConfigureAwait(false);
}
[NadekoCommand, Aliases]
@@ -54,12 +54,12 @@ namespace NadekoBot.Modules.Utility
if (!invs.Any())
{
return new EmbedBuilder()
return _eb.Create()
.WithErrorColor()
.WithDescription(GetText("no_invites"));
}
var embed = new EmbedBuilder().WithOkColor();
var embed = _eb.Create().WithOkColor();
foreach (var inv in invites)
{
var expiryString = (inv.MaxAge is null || inv.MaxAge == 0 || inv.CreatedAt is null)