`/search` fails to fetch class and typedef entity keys
sudojunior opened this issue · 3 comments
sudojunior commented
The typeMap
is shown to have these contained within all
, yet TypeError occurs when it fails to find a class or typedef.
An additional change to /search
requires the consideration of an entity if it's a typedef to treat it similar to a class, but also as it's own type (/docs class class: *
-> /docs typedef typedef: *
).
docs-bot/src/commands/search.ts
Lines 42 to 43 in 98c07eb
For now, an onError
catch would work for the command itself - but it would be troubling if it persists after fix is implemented.
sudojunior commented
sudojunior commented
Code to achieve the above for /search
:
class SearchCommand extends SlashCommand {
// ...
onError(err: Error, ctx: CommandContext) {
ctx.send(
[
'An error has occured, I could not find what you were looking for.',
`> ${err.message}`,
`> \`${ctx.options.query}\` -> ? ${ctx.options.query in TypeNavigator.typeMap.all}`
].join('\n'),
{
ephemeral: true
}
);
}
// ...
}
sudojunior commented