Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 28, 2023
1 parent c92fd08 commit 4d2d552
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 5 additions & 5 deletions cogs/inquiry.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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()}")

Expand Down
7 changes: 5 additions & 2 deletions cogs/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit 4d2d552

Please sign in to comment.