Skip to content

Commit

Permalink
channel maker
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 27, 2023
1 parent bf05898 commit 9dec086
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cogs/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

0 comments on commit 9dec086

Please sign in to comment.