go into command manager
Signed-off-by: Aleksey Selihov <faumaray@gmail.com>
This commit is contained in:
1 parent
b94b634a87
commit
1153721546
19 files changed
+752
-229
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <Command/Interface.hpp>
|
||||
#include <Logger.hpp>
|
||||
#include <format>
|
||||
#include <ts6bot/MusicManager.hpp>
|
||||
|
||||
// --- Play Command ---
|
||||
class Subscribe : public Command
|
||||
{
|
||||
public:
|
||||
|
||||
void execute(const CommandContext& ctx) override
|
||||
{
|
||||
if (ctx.musicManager.expired()) {
|
||||
LOG_ERROR("MusicManager is expired");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string args(ctx.args);
|
||||
std::string invoker(ctx.invokerName);
|
||||
|
||||
if (ctx.musicManager.lock()->subscribe(ctx.clientID)) {
|
||||
ctx.reply("You are now subscribed to the music bot.");
|
||||
} else {
|
||||
ctx.reply("Already subscribed to the music bot.");
|
||||
}
|
||||
}
|
||||
CommandCategory getCategory() const override
|
||||
{
|
||||
return CommandCategory::Session;
|
||||
}
|
||||
std::vector<std::string_view> getAliases() const override
|
||||
{
|
||||
return {"sub"};
|
||||
}
|
||||
std::string_view getDescription() const override
|
||||
{
|
||||
return "Subscribe on playback from bot.";
|
||||
}
|
||||
std::string_view getUsage() const override { return ""; }
|
||||
};
|
||||
Reference in new issue
Block a user