26 lines
928 B
TypeScript
26 lines
928 B
TypeScript
import { v4 as uuid } from 'uuid'
|
|
import { client } from '../..'
|
|
import { logger } from '../logger'
|
|
import { Command } from '../structures/command'
|
|
import { RunOptions } from '../types/commandTypes'
|
|
|
|
export default new Command({
|
|
name: 'closepoll',
|
|
description: 'Aktuelle Umfrage für nächste Watchparty beenden und Gewinner in Event eintragen.',
|
|
options: [],
|
|
run: async (interaction: RunOptions) => {
|
|
const command = interaction.interaction
|
|
const requestId = uuid()
|
|
if (!command.guild) {
|
|
logger.error("No guild found in interaction. Cancelling closing request", { requestId })
|
|
command.followUp("Es gab leider ein Problem. Ich konnte deine Anfrage nicht bearbeiten :(")
|
|
return
|
|
}
|
|
const guildId = command.guildId
|
|
logger.info("Got command for closing poll!", { guildId, requestId })
|
|
|
|
command.followUp("Alles klar, beende die Umfrage :)")
|
|
client.voteController.closePoll(command.guild, requestId)
|
|
}
|
|
})
|