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))