embeds
This commit is contained in:
1 parent
704d590a42
commit
d53fd4790b
2 files changed
+27
-3
No files matched your search
+15
-1
@@ -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("""
|
||||
|
||||
+12
-2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user