40 lines
853 B
C++
40 lines
853 B
C++
#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 ""; }
|
|
};
|