Merged projects with plugins and modules

This commit is contained in:
2024-07-22 01:18:00 +03:00
parent 1fd065f4c2
commit 8ace51c840
59 changed files with 1669 additions and 73 deletions

View File

@@ -0,0 +1,38 @@
using Discord;
using DiscordBotCore.Interfaces;
using DiscordBotCore.Others;
namespace MusicPlayer.Commands;
public class SearchMelody: DBCommand
{
public string Command => "search_melody";
public List<string>? Aliases => null;
public string Description => "Search for a melody in the database";
public string Usage => "search_melody [melody name OR one of its aliases]";
public bool requireAdmin => false;
public void ExecuteServer(DbCommandExecutingArguments args)
{
var title = string.Join(" ", args.Arguments);
if (string.IsNullOrWhiteSpace(title))
{
args.Context.Channel.SendMessageAsync("You need to specify a melody name");
return;
}
List<MusicInfo>? info = Variables._MusicDatabase.GetMusicInfoList(title);
if (info == null || info.Count == 0)
{
args.Context.Channel.SendMessageAsync("No melody with that name or alias was found");
return;
}
if (info.Count > 1)
args.Context.Channel.SendMessageAsync(embed: info.ToEmbed(Color.DarkOrange));
else
args.Context.Channel.SendMessageAsync(embed: info[0].ToEmbed(Color.DarkOrange));
}
}