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:
@@ -51,10 +51,10 @@ public sealed partial class Music
|
||||
}
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithAuthor(GetText(strs.playlists_page(num)), MUSIC_ICON_URL)
|
||||
.WithDescription(string.Join("\n",
|
||||
playlists.Select(r => GetText(strs.playlists(r.Id, r.Name, r.Author, r.Songs.Count)))))
|
||||
.WithOkColor();
|
||||
.WithAuthor(GetText(strs.playlists_page(num)), MUSIC_ICON_URL)
|
||||
.WithDescription(string.Join("\n",
|
||||
playlists.Select(r => GetText(strs.playlists(r.Id, r.Name, r.Author, r.Songs.Count)))))
|
||||
.WithOkColor();
|
||||
|
||||
await Response().Embed(embed).SendAsync();
|
||||
}
|
||||
@@ -111,7 +111,9 @@ public sealed partial class Music
|
||||
mpl.Songs.Skip(cur * 20)
|
||||
.Take(20)
|
||||
.Select(x => $"`{++i}.` [{x.Title.TrimTo(45)}]({x.Query}) `{x.Provider}`"));
|
||||
return new EmbedBuilder().WithTitle($"\"{mpl.Name}\" by {mpl.Author}").WithOkColor().WithDescription(str);
|
||||
return new EmbedBuilder().WithTitle($"\"{mpl.Name}\" by {mpl.Author}")
|
||||
.WithOkColor()
|
||||
.WithDescription(str);
|
||||
},
|
||||
mpl.Songs.Count,
|
||||
20);
|
||||
@@ -151,11 +153,13 @@ public sealed partial class Music
|
||||
await uow.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await Response().Embed(new EmbedBuilder()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.playlist_saved))
|
||||
.AddField(GetText(strs.name), name)
|
||||
.AddField(GetText(strs.id), playlist.Id.ToString())).SendAsync();
|
||||
await Response()
|
||||
.Embed(new EmbedBuilder()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.playlist_saved))
|
||||
.AddField(GetText(strs.name), name)
|
||||
.AddField(GetText(strs.id), playlist.Id.ToString()))
|
||||
.SendAsync();
|
||||
}
|
||||
|
||||
[Cmd]
|
||||
@@ -208,8 +212,9 @@ public sealed partial class Music
|
||||
IUserMessage msg = null;
|
||||
try
|
||||
{
|
||||
msg = await ctx.Channel.SendMessageAsync(
|
||||
GetText(strs.attempting_to_queue(Format.Bold(mpl.Songs.Count.ToString()))));
|
||||
msg = await Response()
|
||||
.Pending(strs.attempting_to_queue(Format.Bold(mpl.Songs.Count.ToString())))
|
||||
.SendAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@ public sealed class MusicService : IMusicService
|
||||
private readonly IBotStrings _strings;
|
||||
private readonly IGoogleApiService _googleApiService;
|
||||
private readonly YtLoader _ytLoader;
|
||||
private readonly IEmbedBuilderService _eb;
|
||||
private readonly IMessageSenderService _sender;
|
||||
|
||||
private readonly ConcurrentDictionary<ulong, IMusicPlayer> _players;
|
||||
private readonly ConcurrentDictionary<ulong, (ITextChannel Default, ITextChannel? Override)> _outputChannels;
|
||||
@@ -31,7 +31,7 @@ public sealed class MusicService : IMusicService
|
||||
IBotStrings strings,
|
||||
IGoogleApiService googleApiService,
|
||||
YtLoader ytLoader,
|
||||
IEmbedBuilderService eb)
|
||||
IMessageSenderService sender)
|
||||
{
|
||||
_voiceStateService = voiceStateService;
|
||||
_trackResolveProvider = trackResolveProvider;
|
||||
@@ -42,7 +42,7 @@ public sealed class MusicService : IMusicService
|
||||
_strings = strings;
|
||||
_googleApiService = googleApiService;
|
||||
_ytLoader = ytLoader;
|
||||
_eb = eb;
|
||||
_sender = sender;
|
||||
|
||||
_players = new();
|
||||
_outputChannels = new ConcurrentDictionary<ulong, (ITextChannel, ITextChannel?)>();
|
||||
|
Reference in New Issue
Block a user