Currently, commands such as UserContextMenu or MessageContextMenu are dynamically generated by the CommandRegistrar and routed via nameAliases from the CommandHandler. This causes the CommandHandler to not have the information of the context menu commands as they do not exist until CommandRegistrar generates them before registering the commands to Discord.
We can keep the command routing logic as it is but let the command handler know about the existence of context menu commands by populating it in the cache immediately after loading the command file.
Currently, commands such as
UserContextMenuorMessageContextMenuare dynamically generated by theCommandRegistrarand routed vianameAliasesfrom theCommandHandler. This causes theCommandHandlerto not have the information of the context menu commands as they do not exist untilCommandRegistrargenerates them before registering the commands to Discord.We can keep the command routing logic as it is but let the command handler know about the existence of context menu commands by populating it in the cache immediately after loading the command file.