From 672ea15515c5225625753d3f8f50bd65f700f0f1 Mon Sep 17 00:00:00 2001 From: Selyss <99344963+Selyss@users.noreply.github.com> Date: Mon, 18 Dec 2023 20:38:37 -0500 Subject: [PATCH] fix closeview --- cogs/ticket.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/cogs/ticket.py b/cogs/ticket.py index 2d0fc03..9dac272 100644 --- a/cogs/ticket.py +++ b/cogs/ticket.py @@ -3,6 +3,7 @@ from nextcord.ext.commands import Bot, Cog import nextcord from .utils.colors import CLOSE_REQUEST +from views.close import CloseView CLOSED_CATEGORY = int(getenv("CLOSED_CATEGORY")) @@ -30,22 +31,6 @@ async def deny(self, button: nextcord.ui.Button, inter: nextcord.Interaction): await inter.channel.send("Request denied!") -class CloseView(nextcord.ui.View): - def __init__(self, inter=None): - super().__init__(timeout=60) - self.inter = inter - - @nextcord.ui.button(label="Acknowledge", style=nextcord.ButtonStyle.blurple) - async def accept(self, button: nextcord.ui.Button, inter: nextcord.Interaction): - category = nextcord.utils.get(inter.guild.categories, id=CLOSED_CATEGORY) - await self.inter.channel.send("Closing ticket...") - await self.inter.channel.edit(category=category) - await self.inter.channel.set_permissions( - self.inter.user, read_messages=False, send_messages=False - ) - # FIXME: duplicate? - - class Ticket(Cog): def __init__(self, bot: Bot) -> None: self.bot = bot