Added /debug-env command (#3727)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "CommandController.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Env.hpp"
|
||||
#include "common/SignalVector.hpp"
|
||||
#include "controllers/accounts/AccountController.hpp"
|
||||
#include "controllers/commands/Command.hpp"
|
||||
@@ -439,6 +440,30 @@ void CommandController::initialize(Settings &, Paths &paths)
|
||||
return "";
|
||||
});
|
||||
|
||||
this->registerCommand("/debug-env", [](const auto & /*words*/,
|
||||
ChannelPtr channel) {
|
||||
auto env = Env::get();
|
||||
|
||||
QStringList debugMessages{
|
||||
"recentMessagesApiUrl: " + env.recentMessagesApiUrl,
|
||||
"linkResolverUrl: " + env.linkResolverUrl,
|
||||
"twitchEmoteSetResolverUrl: " + env.twitchEmoteSetResolverUrl,
|
||||
"twitchServerHost: " + env.twitchServerHost,
|
||||
"twitchServerPort: " + QString::number(env.twitchServerPort),
|
||||
"twitchServerSecure: " + QString::number(env.twitchServerSecure),
|
||||
};
|
||||
|
||||
for (QString &str : debugMessages)
|
||||
{
|
||||
MessageBuilder builder;
|
||||
builder.emplace<TimestampElement>(QTime::currentTime());
|
||||
builder.emplace<TextElement>(str, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
channel->addMessage(builder.release());
|
||||
}
|
||||
return "";
|
||||
});
|
||||
|
||||
this->registerCommand("/uptime", [](const auto & /*words*/, auto channel) {
|
||||
auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
||||
if (twitchChannel == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user