Migrate core infrastructure to VoidLibrary
This commit is contained in:
1 parent
53801f2b53
commit
2bdb63766d
65 files changed
+16109
-12011
No files matched your search
@@ -1,42 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "Command.hpp"
|
||||
#include "echoion/core/Core.hpp" // For Core::reloadConfig
|
||||
#include "echoion/core/Logger.hpp"
|
||||
#include "echoion/core/Core.hpp" // For Core::reloadConfig
|
||||
#include <format>
|
||||
|
||||
namespace Echoion::Core {
|
||||
namespace Echoion::Core
|
||||
{
|
||||
|
||||
class ReloadConfigCommand : public Command {
|
||||
public:
|
||||
void execute(const CommandContext& ctx) override {
|
||||
try {
|
||||
// Note: ctx.core is not directly accessible, we need to use the MusicManager's core reference
|
||||
// For now, reply with instructions
|
||||
ctx.reply("Config reload: Please use !reload command or restart the bot for config changes to take effect.");
|
||||
|
||||
// TODO: Add core reference to CommandContext so commands can call Core methods
|
||||
} catch (const std::exception& e) {
|
||||
ECHOION_LOG_ERROR(std::format("ReloadConfig command exception: {}", e.what()));
|
||||
ctx.reply("Something went wrong. Please try again.");
|
||||
}
|
||||
}
|
||||
class ReloadConfigCommand : public Command
|
||||
{
|
||||
public:
|
||||
|
||||
std::string_view getDescription() const override {
|
||||
return "Reloads the bot configuration from file.";
|
||||
}
|
||||
void execute(const CommandContext& ctx) override
|
||||
{
|
||||
try {
|
||||
// Note: ctx.core is not directly accessible, we need to use
|
||||
// the MusicManager's core reference For now, reply with
|
||||
// instructions
|
||||
ctx.reply(
|
||||
"Config reload: Please use !reload command or restart "
|
||||
"the bot for config changes to take effect.");
|
||||
|
||||
CommandCategory getCategory() const override {
|
||||
return CommandCategory::Admin;
|
||||
}
|
||||
// TODO: Add core reference to CommandContext so commands
|
||||
// can call Core methods
|
||||
} catch (const std::exception& e) {
|
||||
ECHOION_LOG_ERROR(std::format(
|
||||
"ReloadConfig command exception: {}", e.what()));
|
||||
ctx.reply("Something went wrong. Please try again.");
|
||||
}
|
||||
}
|
||||
|
||||
bool requiresAdmin() const override {
|
||||
return true;
|
||||
}
|
||||
std::string_view getDescription() const override
|
||||
{
|
||||
return "Reloads the bot configuration from file.";
|
||||
}
|
||||
|
||||
std::vector<std::string_view> getAliases() const override {
|
||||
return {"reloadcfg", "rlcfg"};
|
||||
}
|
||||
};
|
||||
CommandCategory getCategory() const override
|
||||
{
|
||||
return CommandCategory::Admin;
|
||||
}
|
||||
|
||||
bool requiresAdmin() const override { return true; }
|
||||
|
||||
std::vector<std::string_view> getAliases() const override
|
||||
{
|
||||
return {"reloadcfg", "rlcfg"};
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Echoion::Core
|
||||
Reference in new issue
Block a user