From b329fca54764b4172c0ff6b8a7c6b6a325cb10c9 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sun, 29 Jan 2023 23:00:49 +0100 Subject: [PATCH] Make lualol test command use callEveryWithArgs --- src/controllers/commands/CommandController.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index 27e723b99..a3ddd4128 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -51,6 +51,10 @@ #include #include +extern "C" { +#include +} + 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 ""; }); }