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:
parent
7d4919dee0
commit
ba67c583a2
1 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue