Skip to content

Commit

Permalink
Centralize server id
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 committed Dec 10, 2023
1 parent c00eb16 commit a3c60d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bot/libs/tickets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from bot.cogs.tickets import Tickets
from bot.rodhaj import Rodhaj

TRANSPROGRAMMER_SERVER_ID = 1183302385020436480


class TicketConfirmView(RoboView):
def __init__(
Expand All @@ -24,13 +22,15 @@ def __init__(
ctx: RoboContext,
cog: Tickets,
content: str,
guild_id: int,
delete_after: bool = True,
) -> None:
super().__init__(ctx=ctx, display_message=False)
self.bot = bot
self.ctx = ctx
self.cog = cog
self.content = content
self.guild_id = guild_id
self.delete_after = delete_after
self.pool = self.bot.pool

Expand All @@ -54,7 +54,7 @@ async def confirm(
author = self.ctx.author
ticket = TicketThread(
user=author,
location_id=TRANSPROGRAMMER_SERVER_ID,
location_id=self.guild_id,
content=self.content,
created_at=discord.utils.utcnow(),
)
Expand Down
4 changes: 3 additions & 1 deletion bot/rodhaj.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ async def on_message(self, message: discord.Message) -> None:
"\n\nNote: Once you have created your ticket, this prompt will not show up again"
)

view = TicketConfirmView(self, ctx, tickets_cog, message.content)
view = TicketConfirmView(
self, ctx, tickets_cog, message.content, TRANSPROGRAMMER_SERVER_ID
)
view.message = await author.send(embed=embed, view=view)
return

Expand Down

0 comments on commit a3c60d7

Please sign in to comment.