years from 1900 to 2023

This commit is contained in:
Jonny_Bro (Nikita) 2023-05-31 21:49:14 +05:00
parent a76eb997bc
commit fd6e23c014

View file

@ -84,7 +84,7 @@ class Birthdate extends BaseCommand {
*/ */
async autocompleteRun(client, interaction) { async autocompleteRun(client, interaction) {
const int = interaction.options.getInteger("year"), const int = interaction.options.getInteger("year"),
results = Array.from({ length: 2023 }, (_, k) => k + 1).filter(i => i.toString().includes(int)); results = Array.from({ length: (2023 - 1900) / 1 }, (_, i) => 1900 + i * 1).filter(i => i.toString().includes(int));
return interaction.respond( return interaction.respond(
results.slice(0, 25).map(i => ({ results.slice(0, 25).map(i => ({