diff --git a/cogs/inquiry.py b/cogs/inquiry.py index 3b8a210..46a7fc6 100644 --- a/cogs/inquiry.py +++ b/cogs/inquiry.py @@ -1,8 +1,8 @@ from datetime import datetime +import json from nextcord import slash_command from nextcord.ext.commands import Bot, Cog import nextcord -import json with open("config.json", "r", encoding="utf-8") as config_file: @@ -137,11 +137,11 @@ def __init__(self): ) self.add_item(self.details) - async def callback(self, interaction: nextcord.Interaction) -> None: - if isinstance(interaction.channel, nextcord.TextChannel): - target_channel = interaction.guild.get_channel(REQUEST_CHANNEL) + async def callback(self, inter: nextcord.Interaction) -> None: + if isinstance(inter.channel, nextcord.TextChannel): + target_channel = inter.guild.get_channel(REQUEST_CHANNEL) em = nextcord.Embed() - em.set_author(icon_url=interaction.user.avatar, name=interaction.user.name) + em.set_author(icon_url=inter.user.avatar, name=interaction.user.name) em.add_field(name="**reason**", value=self.details.value) em.set_footer(text=f"{inter.user.id} • {get_date()} • {get_time()}") diff --git a/cogs/ticket.py b/cogs/ticket.py index bca028a..da3879e 100644 --- a/cogs/ticket.py +++ b/cogs/ticket.py @@ -26,11 +26,14 @@ async def set_log_channel( ): config["request_channel"] = request_channel.id config["advertise_channel"] = ad_channel.id - with open("config.json", "w") as config_file: + with open("config.json", "w", encoding="utf-8") as config_file: json.dump(config, config_file, indent=4) await inter.send( - f"Request channel set to <#{request_channel.id}>. Advertisement channel set to <#{ad_channel.id}>.", + f""" + Request channel set to <#{request_channel.id}> + Advertisement channel set to <#{ad_channel.id}> + """, ephemeral=True, )