2023-06-10 17:27:32 +02:00
|
|
|
import { v4 as uuid } from 'uuid'
|
2023-06-14 22:24:39 +02:00
|
|
|
import { client } from '../..'
|
2023-06-10 22:53:11 +02:00
|
|
|
import { logger } from '../logger'
|
|
|
|
import { Command } from '../structures/command'
|
|
|
|
import { RunOptions } from '../types/commandTypes'
|
2023-06-10 17:27:32 +02:00
|
|
|
|
|
|
|
export default new Command({
|
2023-06-24 21:09:56 +02:00
|
|
|
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 :)")
|
2023-07-05 22:55:24 +02:00
|
|
|
client.voteController.closePoll(command.guild, requestId)
|
2023-06-24 21:09:56 +02:00
|
|
|
}
|
2023-06-10 22:53:11 +02:00
|
|
|
})
|