Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Dec 19, 2023
1 parent d411b61 commit 5e6a438
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions cogs/inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ async def advertisement(self, btn: nextcord.ui.Button, inter: nextcord.Interacti


class QuickResponse(nextcord.ui.Modal):
def __init__(self, person, message) -> None:
def __init__(self, person, message, full) -> None:
super().__init__(
title="Quick Response",
custom_id="ticket:quickresponse",
timeout=None,
)
self.person = person
self.message = message
self.full = full

self.details = nextcord.ui.TextInput(
label="Response",
Expand All @@ -87,8 +88,15 @@ async def callback(self, inter: nextcord.Interaction) -> None:
person = await inter.guild.fetch_member(self.person)
id = person.id
name = person.name
nick = person.nick
nick = person.global_name
category = nextcord.utils.get(inter.guild.categories, id=CLOSED_CATEGORY)
ac = nextcord.Embed()
ac.title = "Accepted"
ac.color = SUCCESS
ac.set_author(icon_url=inter.user.avatar, name=inter.user.name)
ac.description = self.message
ac.set_footer(text=format_footer(inter.user.id))
await inter.message.edit(embed=ac)
new_channel = await category.create_text_channel(
name=f"ticket-{name}",
reason=f"Created ticket for {id} - {name}",
Expand All @@ -110,9 +118,7 @@ async def callback(self, inter: nextcord.Interaction) -> None:
# response msg
em = nextcord.Embed()
em.color = REPLY
em.set_author(
name=f"{inter.user.nick} replied:", icon_url=inter.user.avatar
)
em.set_author(name=f"{inter.user} replied:", icon_url=inter.user.avatar)
em.description = self.details.value
em.set_footer(text='Press "Acknowledge" to close.')

Expand All @@ -139,8 +145,14 @@ async def accept(self, btn: nextcord.ui.Button, inter: nextcord.Interaction):
person = await inter.guild.fetch_member(msg)
id = person.id
name = person.name
nick = person.nick
await inter.message.delete()
nick = person.global_name
ac = nextcord.Embed()
ac.title = "Accepted"
ac.color = SUCCESS
ac.set_author(icon_url=inter.user.avatar, name=inter.user.name)
ac.description = content
ac.set_footer(text=format_footer(inter.user.id))
await inter.message.edit(embed=ac)
em = nextcord.Embed()
if inter.channel.id == AD_CHANNEL:
# IS AD
Expand Down Expand Up @@ -206,7 +218,8 @@ async def accept(self, btn: nextcord.ui.Button, inter: nextcord.Interaction):
async def quickresponse(self, btn: nextcord.ui.Button, inter: nextcord.Interaction):
msg = await get_id_from_em(inter)
content = inter.message.embeds[0].description
await inter.response.send_modal(QuickResponse(msg, content))
full = inter.message.embeds[0]
await inter.response.send_modal(QuickResponse(msg, content, full))


class AdForm(nextcord.ui.Modal):
Expand Down

0 comments on commit 5e6a438

Please sign in to comment.