go into command manager

Signed-off-by: Aleksey Selihov <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-01-27 23:29:04 +03:00
1 parent b94b634a87
commit 1153721546
19 files changed
+752 -229

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
#pragma once
#include <Command/Interface.hpp>
#include <Logger.hpp>
#include <format>
#include <ts6bot/MusicManager.hpp>
// --- Play Command ---
class UnSubscribe : public Command
{
public:
void execute(const CommandContext& ctx) override
{
if (ctx.musicManager.expired()) {
LOG_ERROR("MusicManager is expired");
return;
}
if (ctx.musicManager.lock()->unSubscribe(ctx.clientID)) {
ctx.reply("Unsubscribed.");
} else {
ctx.reply("Already not subscribed.");
}
}
CommandCategory getCategory() const override
{
return CommandCategory::Session;
}
std::vector<std::string_view> getAliases() const override
{
return {"unsub"};
}
std::string_view getDescription() const override
{
return "UnSubscribe from playback from bot.";
}
std::string_view getUsage() const override { return ""; }
};