Skip to content

Commit

Permalink
Merge pull request #331 from Token07/rm-info-autocomplete-debug
Browse files Browse the repository at this point in the history
Remove debug from autocomplete
  • Loading branch information
Token07 authored Jul 26, 2024
2 parents e87f503 + f0d4a31 commit 5ef8add
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,7 @@ export default class Info {
const noteName = interaction.options.get("name")?.value?.toString().toLocaleLowerCase() || "";
const useEmbed = interaction.options.get("embed")?.value as boolean
if (interaction.isAutocomplete()) {
const autocompleteText = interaction.options.getFocused(true).value
console.log(`Autocomplete: ${autocompleteText}`)
const autocompleteText = interaction.options.getFocused(true).value;
if (autocompleteText == "") return interaction.respond([...new Set<string>(this.recents)].filter(r => r.length <= 100).slice(0, 24).map((r => { return {name: r, value: r} })));
const startsWithNotes = this.infos.filter(info => info.command.startsWith(autocompleteText));
const matchingNotes = this.infos.filter(info => !info.command.startsWith(autocompleteText) && info.command.indexOf(autocompleteText) !== -1);
Expand Down

0 comments on commit 5ef8add

Please sign in to comment.