Updated formatting on modals and autocomplete

This commit is contained in:
2024-01-20 17:34:25 +01:00
parent e60523c7b6
commit 631581574c
4 changed files with 60 additions and 146 deletions

View File

@@ -9,21 +9,15 @@ export = {
if (focusedOption.name !== "user") return
if (focusedOption.value === "") {
await interaction.respond([
{
name: "Please start typing a username to unban",
value: "none"
}
])
await interaction.respond([{
name: "Please start typing a username to unban",
value: "none"
}])
return
}
const bannedUsers = await interaction.guild!.bans.fetch()
const filteredUsers = bannedUsers.filter(user =>
user.user.username
.toLowerCase()
.includes(focusedOption.value.toLowerCase())
)
const filteredUsers = bannedUsers.filter(user => user.user.username.toLowerCase().includes(focusedOption.value.toLowerCase()))
const results = filteredUsers.map(user => ({
name: user.user.username,