Adds eslint and linted & improved routing for interactions

This commit is contained in:
Michel Fedde 2025-06-17 20:37:53 +02:00
parent 83209f642c
commit 441715675c
35 changed files with 2091 additions and 463 deletions

View file

@ -1,9 +1,7 @@
import {
AutocompleteInteraction,
ChatInputCommandInteraction,
CommandInteraction,
GuildMember, SlashCommandIntegerOption,
SlashCommandStringOption
} from "discord.js";
import {Container} from "../../Container/Container";
import {GroupRepository} from "../../Repositories/GroupRepository";
@ -22,7 +20,7 @@ export class GroupSelection {
public static async handleAutocomplete(interaction: AutocompleteInteraction, onlyLeaders: boolean = false): Promise<void> {
const value = interaction.options.getFocused();
const repo = Container.get<GroupRepository>(GroupRepository.name);
let groups = repo.findGroupsByMember(<GuildMember>interaction.member, onlyLeaders);
const groups = repo.findGroupsByMember(<GuildMember>interaction.member, onlyLeaders);
await interaction.respond(
groups
.filter((group) => group.name.startsWith(value))