mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Added /debug-env
command (#3727)
This commit is contained in:
parent
0c6358a2af
commit
5ba3ef721f
1 changed files with 25 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "CommandController.hpp"
|
#include "CommandController.hpp"
|
||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
|
#include "common/Env.hpp"
|
||||||
#include "common/SignalVector.hpp"
|
#include "common/SignalVector.hpp"
|
||||||
#include "controllers/accounts/AccountController.hpp"
|
#include "controllers/accounts/AccountController.hpp"
|
||||||
#include "controllers/commands/Command.hpp"
|
#include "controllers/commands/Command.hpp"
|
||||||
|
@ -439,6 +440,30 @@ void CommandController::initialize(Settings &, Paths &paths)
|
||||||
return "";
|
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) {
|
this->registerCommand("/uptime", [](const auto & /*words*/, auto channel) {
|
||||||
auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
||||||
if (twitchChannel == nullptr)
|
if (twitchChannel == nullptr)
|
||||||
|
|
Loading…
Reference in a new issue