Make lualol test command use callEveryWithArgs

This commit is contained in:
Mm2PL 2023-01-29 23:00:49 +01:00
parent f5f0a3301f
commit b329fca547
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9

View file

@ -51,6 +51,10 @@
#include <QRegularExpression>
#include <QUrl>
extern "C" {
#include <lua.h>
}
namespace {
using namespace chatterino;
@ -3127,7 +3131,10 @@ void CommandController::initialize(Settings &, Paths &paths)
return "";
});
this->registerCommand("lualol", [](const auto &ctx) {
getApp()->plugins->callEvery("test");
getApp()->plugins->callEveryWithArgs(
"test", 1, [ctx](const auto & /*pl*/, lua_State *L) {
lua_pushstring(L, ctx.channel->getName().toStdString().c_str());
});
return "";
});
}