mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
fix(logs): now are empheral
This commit is contained in:
@@ -21,6 +21,16 @@ class Logs(commands.Cog, name="logs"):
|
|||||||
else:
|
else:
|
||||||
await context.send(embed=embed)
|
await context.send(embed=embed)
|
||||||
|
|
||||||
|
async def send_file(self, context: Context, *, file: discord.File, ephemeral: bool = False) -> None:
|
||||||
|
interaction = getattr(context, "interaction", None)
|
||||||
|
if interaction is not None:
|
||||||
|
if interaction.response.is_done():
|
||||||
|
await interaction.followup.send(file=file, ephemeral=ephemeral)
|
||||||
|
else:
|
||||||
|
await interaction.response.send_message(file=file, ephemeral=ephemeral)
|
||||||
|
else:
|
||||||
|
await context.send(file=file)
|
||||||
|
|
||||||
@commands.hybrid_command(
|
@commands.hybrid_command(
|
||||||
name="logs",
|
name="logs",
|
||||||
description="View the bot's log file",
|
description="View the bot's log file",
|
||||||
@@ -77,7 +87,7 @@ class Logs(commands.Cog, name="logs"):
|
|||||||
f.write(log_content)
|
f.write(log_content)
|
||||||
|
|
||||||
file_obj = discord.File(log_file)
|
file_obj = discord.File(log_file)
|
||||||
await context.send(file=file_obj)
|
await self.send_file(context, file=file_obj, ephemeral=True)
|
||||||
|
|
||||||
os.remove(log_file)
|
os.remove(log_file)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user