- 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

@@ -61,11 +61,13 @@ namespace NadekoBot.Modules.Music
playlists = uow.MusicPlaylists.GetPlaylistsOnPage(num);
}
var embed = new EmbedBuilder()
var embed = _eb
.Create(ctx)
.WithAuthor(GetText("playlists_page", num), MusicIconUrl)
.WithDescription(string.Join("\n", playlists.Select(r =>
GetText("playlists", r.Id, r.Name, r.Author, r.Songs.Count))))
.WithOkColor();
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
}
@@ -122,7 +124,7 @@ namespace NadekoBot.Modules.Music
.Skip(cur * 20)
.Take(20)
.Select(x => $"`{++i}.` [{x.Title.TrimTo(45)}]({x.Query}) `{x.Provider}`"));
return new EmbedBuilder()
return _eb.Create()
.WithTitle($"\"{mpl.Name}\" by {mpl.Author}")
.WithOkColor()
.WithDescription(str);
@@ -162,7 +164,7 @@ namespace NadekoBot.Modules.Music
await uow.SaveChangesAsync();
}
await ctx.Channel.EmbedAsync(new EmbedBuilder()
await ctx.Channel.EmbedAsync(_eb.Create()
.WithOkColor()
.WithTitle(GetText("playlist_saved"))
.AddField(GetText("name"), name)