Skip to content

Commit

Permalink
refactor channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 27, 2023
1 parent 9dec086 commit e7c887e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cogs/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ async def set_log_channel(
ephemeral=True,
)

@slash_command(name="ticket")
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}",
name=f"ticket-{inter.user.name}",
reason=f"Created ticket for {inter.user.id} - {inter.user.name}",
)
await inter.response.send_message(
f"Ticket created: <#{new_channel.id}>", ephemeral=True
)
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:
Expand Down

0 comments on commit e7c887e

Please sign in to comment.