Skip to content

Commit

Permalink
fix closeview
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Dec 19, 2023
1 parent 5e6a438 commit 672ea15
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions cogs/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 672ea15

Please sign in to comment.