0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 11:18:51 +02:00

modules/console: Allow event_id argument to fetch content for text to label cmd.

This commit is contained in:
Jason Volk 2022-07-21 12:03:47 -07:00
parent 7d4919dee0
commit ba67c583a2

View file

@ -17922,11 +17922,21 @@ console_cmd__gpt__label(opt &out, const string_view &line)
param["label"], true
};
const auto text
auto text
{
tokens_after(line, ' ', 0)
};
std::string content;
if(m::valid(m::id::EVENT, text))
content = m::get(std::nothrow, m::event::id{text}, "content");
if(!content.empty())
content = json::object(content).get<json::string>("body");
if(!content.empty())
text = content;
gpt::opts opts alignas(4096);
opts.limit = 0;
opts.debug |= 0x40;