Reworked the Config system

This commit is contained in:
2024-08-06 19:07:08 +03:00
parent 8366de28cc
commit 721c28c283
28 changed files with 740 additions and 318 deletions

View File

@@ -29,6 +29,13 @@ public class Play: DBSlashCommand
public async void ExecuteServer(SocketSlashCommand context)
{
if(Variables._MusicDatabase is null)
{
await context.RespondAsync("Music Database is not loaded !");
return;
}
var melodyName = context.Data.Options.First().Value as string;
if (melodyName is null)
@@ -37,8 +44,8 @@ public class Play: DBSlashCommand
return;
}
var melody = Variables._MusicDatabase.GetMusicInfo(melodyName);
if (melody is null)
var melody = Variables._MusicDatabase.GetMusicInfoWithTitleOrAlias(melodyName);
if (!melody.Any())
{
await context.RespondAsync("The searched melody does not exists in the database. Sorry :(");
return;
@@ -71,6 +78,7 @@ public class Play: DBSlashCommand
await context.RespondAsync("Failed to enqueue your request. Something went wrong !");
return;
}
await context.RespondAsync("Enqueued your request");
await Variables._MusicPlayer.PlayQueue(); //start queue