Updated prune command
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChatInputCommandInteraction } from "discord.js"
|
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, ChatInputCommandInteraction, ComponentType } from "discord.js"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import env from "utils/Env"
|
import env from "utils/Env"
|
||||||
|
|
||||||
@@ -58,9 +58,13 @@ export default async function prune(interaction: ChatInputCommandInteraction): P
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
const filter = (i: any) => i.customId === "staff_prune_confirm" && i.user.id === interaction.user.id
|
const filter = (i: ButtonInteraction) => i.customId === "staff_prune_confirm" && i.user.id === interaction.user.id
|
||||||
|
|
||||||
const collector = interaction.channel!.createMessageComponentCollector({ filter, time: 60000 })
|
const collector = interaction.channel!.createMessageComponentCollector({
|
||||||
|
componentType: ComponentType.Button,
|
||||||
|
filter: filter,
|
||||||
|
time: 5 * 60 * 1000
|
||||||
|
})
|
||||||
|
|
||||||
collector.on("collect", async i => {
|
collector.on("collect", async i => {
|
||||||
await i.deferUpdate()
|
await i.deferUpdate()
|
||||||
@@ -79,7 +83,13 @@ export default async function prune(interaction: ChatInputCommandInteraction): P
|
|||||||
color: embedColor
|
color: embedColor
|
||||||
}],
|
}],
|
||||||
components: []
|
components: []
|
||||||
|
}).then(() => {
|
||||||
|
collector.stop()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
collector.on("end", async () => {
|
||||||
|
// ...
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user