From 9dec086f498cfabea74adf981d37ad67072312dc Mon Sep 17 00:00:00 2001 From: Selyss <99344963+Selyss@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:37:40 -0500 Subject: [PATCH] channel maker --- cogs/ticket.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cogs/ticket.py b/cogs/ticket.py index 9b46ed2..e3d1bc3 100644 --- a/cogs/ticket.py +++ b/cogs/ticket.py @@ -3,6 +3,9 @@ import nextcord import json +# TODO: add to config +TICKET_CATEGORY: int = 1178415757378461727 + with open("config.json", "r") as config_file: config = json.load(config_file) @@ -34,6 +37,16 @@ async def set_log_channel( ephemeral=True, ) + async def create_ticket(self, inter: nextcord.Interaction) -> None: + category = nextcord.utils.get(inter.guild.categories, id=TICKET_CATEGORY) + new_channel = await category.create_text_channel( + inter.user.name, + overwrites=None, + reason=f"Made ticket for {inter.user.name}", + ) + await new_channel.send("This is your new channel!") + await interaction.response.send_message(f"Channel created: <#{new_channel.id}>") + def setup(bot: Bot) -> None: bot.add_cog(Ticket(bot))