diff --git a/cogs/inquiry.py b/cogs/inquiry.py index 94b143c..a8de392 100644 --- a/cogs/inquiry.py +++ b/cogs/inquiry.py @@ -5,7 +5,7 @@ import nextcord from os import getenv from .utils.colors import EMBED_COLOR, SUCCESS, INQUIRY, REPLY -from .utils.formatting import get_date, get_time, format_footer +from .utils.formatting import format_footer load_dotenv() @@ -68,14 +68,15 @@ def __init__(self) -> None: custom_id="closeview:close", ) async def close(self, btn: nextcord.ui.Button, inter: nextcord.Interaction): - await inter.channel.send("Closing ticket...") - category = inter.guild.get_channel(CLOSED_CATEGORY) - await inter.channel.edit(category=category) - # TODO: remove person from ticket + if isinstance(inter.channel, nextcord.TextChannel): + await inter.channel.send("Closing ticket...") + category = inter.guild.get_channel(CLOSED_CATEGORY) + await inter.channel.edit(category=category) + # TODO: remove person from ticket class QuickResponse(nextcord.ui.Modal): - def __init__(self, person: int, message: str) -> None: + def __init__(self, person, message) -> None: super().__init__( title="Quick Response", custom_id="ticket:quickresponse", @@ -192,14 +193,15 @@ def __init__(self) -> None: label="Mark Paid", style=nextcord.ButtonStyle.green, custom_id="ticket:paid" ) async def paid(self, btn: nextcord.ui.Button, inter: nextcord.Interaction): - category = nextcord.utils.get(inter.guild.categories, id=PAID_CATEGORY) - await inter.channel.edit(category=category) - em = nextcord.Embed() - em.color = SUCCESS - em.title = ":checkmark: Payment Received" - em.description = """Thank you for your purchase!\nIf you haven't already, please send your advertisement message and ensure if you are using any custom/nitro-accessed Emojis that they are present within the Discord you are advertising (emojis from our server are fine, too).\n\nIf another advertisement was recently posted, out of courtesy it will be given a reasonable amount of uptime before yours is posted.""" - em.set_footer(text=format_footer(inter.user.id)) - await inter.response.send_message(embed=em) + if isinstance(inter.channel, nextcord.TextChannel): + category = nextcord.utils.get(inter.guild.categories, id=PAID_CATEGORY) + await inter.channel.edit(category=category) + em = nextcord.Embed() + em.color = SUCCESS + em.title = ":checkmark: Payment Received" + em.description = """Thank you for your purchase!\nIf you haven't already, please send your advertisement message and ensure if you are using any custom/nitro-accessed Emojis that they are present within the Discord you are advertising (emojis from our server are fine, too).\n\nIf another advertisement was recently posted, out of courtesy it will be given a reasonable amount of uptime before yours is posted.""" + em.set_footer(text=format_footer(inter.user.id)) + await inter.response.send_message(embed=em) class AdForm(nextcord.ui.Modal):