mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: added future features 👀
This commit is contained in:
1 parent
0db96795b3
commit
db976c4ae9
7 files changed
+214
-138
No files matched your search
@@ -25,6 +25,4 @@ export default async function autocompleteClan(
|
||||
)
|
||||
: [],
|
||||
);
|
||||
|
||||
console.log(`Clan autocomplete for ${focusedOption.value}`);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { AutocompleteInteraction, CacheType } from 'discord.js';
|
||||
import { go } from 'fuzzysort';
|
||||
import { STAT_PROPERTIES } from '../blitzkrieg/addStatPropertyOptions';
|
||||
|
||||
export default async function autocompleteStatProperty(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
name = 'stat-property',
|
||||
) {
|
||||
const focusedOption = interaction.options.getFocused(true);
|
||||
if (focusedOption.name !== name) return;
|
||||
|
||||
await interaction.respond(
|
||||
focusedOption.value
|
||||
? go(focusedOption.value, STAT_PROPERTIES, {
|
||||
keys: ['name'],
|
||||
limit: 10,
|
||||
}).map(({ obj }) => obj)
|
||||
: STAT_PROPERTIES.slice(0, 25),
|
||||
);
|
||||
}
|
||||
@@ -28,6 +28,4 @@ export default async function autocompleteTanks(
|
||||
)
|
||||
: [],
|
||||
);
|
||||
|
||||
console.log(`Tanks autocomplete for ${focusedOption.value}`);
|
||||
}
|
||||
@@ -25,11 +25,5 @@ export default async function autocompleteUsername(
|
||||
)
|
||||
: [],
|
||||
);
|
||||
|
||||
console.log(`Username autocomplete for ${focusedOption.value}`);
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
`Failed to autocomplete username for ${focusedOption.value} in time`,
|
||||
);
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
Reference in new issue
Block a user