This commit is contained in:
Soenke committed 2026-09-23 18:14:39 +02:00
1 parent 704d590a42
commit d53fd4790b
2 files changed
+29 -5

No files matched your search

+16 -2
View File
@@ -10,7 +10,21 @@ class Database:
async def connect(self):
if self.conn is None:
os.makedirs(os.path.dirname(DB_PATH), exist_ok=True)
self.conn = await aiosqlite.connect(DB_PATH)
db_existed = os.path.exists(DB_PATH)
if db_existed:
print(f"Using existing database file at {DB_PATH}")
else:
print(f"Database file not found at {DB_PATH}, creating a new one...")
try:
self.conn = await aiosqlite.connect(DB_PATH)
except aiosqlite.Error as e:
print(f"Failed to open database at {DB_PATH}: {e}")
raise
if not db_existed and not os.path.exists(DB_PATH):
print(f"Warning: database file was expected at {DB_PATH} but still missing after connect.")
try:
await self.conn.executescript("""
@@ -44,7 +58,7 @@ class Database:
await self.conn.commit()
print("Table check/creation completed successfully.")
except aiosqlite.Error as e:
print(f"Failed to check/creation table: {e}")
+13 -3
View File
@@ -72,7 +72,12 @@ class TicketControlsView(discord.ui.View):
if self._is_de else
f"{interaction.user.mention} has claimed this ticket!"
)
await interaction.followup.send(claim_msg, ephemeral=False)
embed = discord.Embed(
title="INFO",
description=claim_msg,
color=255
)
await interaction.followup.send(embed=embed, ephemeral=False)
bot = interaction.client
@@ -118,7 +123,12 @@ class TicketControlsView(discord.ui.View):
if self._is_de else
f"This ticket has been closed by {interaction.user.mention}!"
)
await interaction.response.send_message(close_msg, ephemeral=False)
embed = discord.Embed(
title="INFO",
description=close_msg,
color=255
)
await interaction.response.send_message(embed=embed, ephemeral=False)
bot = interaction.client
@@ -221,7 +231,7 @@ async def CreateTicketChannel(interaction: discord.Interaction, chosen_language,
)
UserText = f"Hallo {interaction.user.mention}, wir kümmern uns in Kürze um Sie.\nIn der Zwischenzeit können Sie Ihr Problem näher beschreiben." if chosen_language == "de" else f"Hello, {interaction.user.mention}. We will be with you shortly.\nIn the meantime, you can provide a more detailed description of your issue."
await ticket_channel.send(UserText)
return ticket_channel