- 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

@@ -41,7 +41,7 @@ namespace NadekoBot.Modules.Xp
[NadekoCommand, Aliases]
public async Task XpRewsReset()
{
var reply = await PromptUserConfirmAsync(new EmbedBuilder()
var reply = await PromptUserConfirmAsync(_eb.Create()
.WithPendingColor()
.WithDescription(GetText("xprewsreset_confirm")));
@@ -91,7 +91,7 @@ namespace NadekoBot.Modules.Xp
return Context.SendPaginatedConfirmAsync(page, cur =>
{
var embed = new EmbedBuilder()
var embed = _eb.Create()
.WithTitle(GetText("level_up_rewards"))
.WithOkColor();
@@ -200,7 +200,7 @@ namespace NadekoBot.Modules.Xp
var globalSetting = _service.GetNotificationType(ctx.User);
var serverSetting = _service.GetNotificationType(ctx.User.Id, ctx.Guild.Id);
var embed = new EmbedBuilder()
var embed = _eb.Create()
.WithOkColor()
.AddField(GetText("xpn_setting_global"), GetNotifLocationString(globalSetting))
.AddField(GetText("xpn_setting_server"), GetNotifLocationString(serverSetting));
@@ -288,7 +288,7 @@ namespace NadekoBot.Modules.Xp
var lines = desc.Split('\n');
await ctx.SendPaginatedConfirmAsync(0, curpage =>
{
var embed = new EmbedBuilder()
var embed = _eb.Create()
.WithTitle(GetText("exclusion_list"))
.WithDescription(string.Join('\n', lines.Skip(15 * curpage).Take(15)))
.WithOkColor();
@@ -331,7 +331,7 @@ namespace NadekoBot.Modules.Xp
await ctx.SendPaginatedConfirmAsync(page, (curPage) =>
{
var embed = new EmbedBuilder()
var embed = _eb.Create()
.WithTitle(GetText("server_leaderboard"))
.WithOkColor();
@@ -379,7 +379,7 @@ namespace NadekoBot.Modules.Xp
return;
var users = _service.GetUserXps(page);
var embed = new EmbedBuilder()
var embed = _eb.Create()
.WithTitle(GetText("global_leaderboard"))
.WithOkColor();