[DiscordArchive] does **PLAYER_EVENT_ON_COMMAND** only fire on failed commands?
[DiscordArchive] does **PLAYER_EVENT_ON_COMMAND** only fire on failed commands?
Archived author: Anchy • Posted: 2023-02-14T04:16:45.997000+00:00
Original source
what command are you trying to use
Archived author: Anchy • Posted: 2023-02-14T04:17:44.622000+00:00
Original source
that hook is called twice internally
Archived author: Anchy • Posted: 2023-02-14T04:17:47.488000+00:00
Original source
```cpp
if (cmd)
{ /* if we matched a command at some point, invoke it */
handler.SetSentErrorMessage(false);
if (cmd->IsInvokerVisible(handler) && cmd->_invoker(&handler, oldTail))
{ /* invocation succeeded, log this */
if (!handler.IsConsole())
LogCommandUsage(*handler.GetSession(), cmdStr);
}
else if (!handler.HasSentErrorMessage()) /* invocation failed, we should show usage */
{
if (!sScriptMgr->CanExecuteCommand(handler, cmdStr))
{
return true;
}
cmd->SendCommandHelp(handler);
handler.SetSentErrorMessage(true);
}
return true;
}
if (!sScriptMgr->CanExecuteCommand(handler, cmdStr))
{
return true;
}```
Archived author: 0xCiBeR • Posted: 2023-02-14T04:18:32.181000+00:00
Original source
The idea is to "log" every command to discord
Archived author: 0xCiBeR • Posted: 2023-02-14T04:19:00.035000+00:00
Original source
tried for example, .tele gmisland / .appear player
Archived author: 0xCiBeR • Posted: 2023-02-14T04:20:04.898000+00:00
Original source
seems when command has subcommand it doesnt get fired
Archived author: 0xCiBeR • Posted: 2023-02-14T04:20:25.751000+00:00
Original source
For example:
.tele gmisland -> Not Fired
.tele -> Fired
Archived author: 0xCiBeR • Posted: 2023-02-14T04:21:29.821000+00:00
Original source
.asdd asdasd -> Fired(cmd doesn't exist)
Archived author: Anchy • Posted: 2023-02-14T04:23:46.157000+00:00
Original source
I'll just verify it from the c++ side real quick
Archived author: Anchy • Posted: 2023-02-14T04:25:00.058000+00:00
Original source
I am observing the same results in my c++ module, it seems to be an issue on the core side