Bot Command Tooltip: Fix sending incorrect command
This commit is contained in:
parent
9573e89463
commit
6ad144e292
@ -55,7 +55,7 @@ const BotCommandTooltip: FC<OwnProps & StateProps> = ({
|
||||
|
||||
const handleSelect = useCallback((botCommand: ApiBotCommand) => {
|
||||
// We need an additional check because tooltip is updated with throttling
|
||||
if (!botCommand.command.startsWith(getHtml())) {
|
||||
if (!botCommand.command.startsWith(getHtml().slice(1))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ export default function useBotCommandTooltip(
|
||||
}
|
||||
|
||||
const filter = command.substring(1);
|
||||
const nextFilteredBotCommands = commands.filter((c) => !filter || c.command.includes(filter));
|
||||
const nextFilteredBotCommands = commands.filter((c) => !filter || c.command.startsWith(filter));
|
||||
|
||||
setFilteredBotCommands(
|
||||
nextFilteredBotCommands?.length ? nextFilteredBotCommands : undefined,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user