mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
fix
This commit is contained in:
@@ -93,12 +93,42 @@ class VideoArchiver(GroupCog):
|
|||||||
# Set up events - non-blocking
|
# Set up events - non-blocking
|
||||||
setup_events(self)
|
setup_events(self)
|
||||||
|
|
||||||
|
async def _handle_response(self, ctx: Context, content: str = None, embed: discord.Embed = None) -> None:
|
||||||
|
"""Helper method to handle responses for both regular commands and interactions"""
|
||||||
|
try:
|
||||||
|
if hasattr(ctx, 'interaction') and ctx.interaction:
|
||||||
|
if not ctx.interaction.response.is_done():
|
||||||
|
if embed:
|
||||||
|
await ctx.interaction.response.send_message(content=content, embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.interaction.response.send_message(content=content)
|
||||||
|
else:
|
||||||
|
if embed:
|
||||||
|
await ctx.followup.send(content=content, embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.followup.send(content=content)
|
||||||
|
else:
|
||||||
|
if embed:
|
||||||
|
await ctx.send(content=content, embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.send(content=content)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error sending response: {e}")
|
||||||
|
# If all else fails, try to send a regular message
|
||||||
|
try:
|
||||||
|
if embed:
|
||||||
|
await ctx.send(content=content, embed=embed)
|
||||||
|
else:
|
||||||
|
await ctx.send(content=content)
|
||||||
|
except Exception as e2:
|
||||||
|
logger.error(f"Failed to send fallback message: {e2}")
|
||||||
|
|
||||||
@hybrid_group(name="archivedb", fallback="help")
|
@hybrid_group(name="archivedb", fallback="help")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
async def archivedb(self, ctx: Context):
|
async def archivedb(self, ctx: Context):
|
||||||
"""Manage the video archive database."""
|
"""Manage the video archive database."""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send_help(ctx.command)
|
await self._handle_response(ctx, "Use `/help archivedb` for a list of commands.")
|
||||||
|
|
||||||
@archivedb.command(name="enable")
|
@archivedb.command(name="enable")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -111,7 +141,7 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "use_database"
|
ctx.guild.id, "use_database"
|
||||||
)
|
)
|
||||||
if current_setting:
|
if current_setting:
|
||||||
await ctx.send("The video archive database is already enabled.")
|
await self._handle_response(ctx, "The video archive database is already enabled.")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Initialize database
|
# Initialize database
|
||||||
@@ -127,12 +157,11 @@ class VideoArchiver(GroupCog):
|
|||||||
await self.config_manager.update_setting(ctx.guild.id, "use_database", True)
|
await self.config_manager.update_setting(ctx.guild.id, "use_database", True)
|
||||||
|
|
||||||
# Send success message
|
# Send success message
|
||||||
await ctx.send("Video archive database has been enabled.")
|
await self._handle_response(ctx, "Video archive database has been enabled.")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error enabling database: {e}")
|
logger.error(f"Error enabling database: {e}")
|
||||||
# Send single error message
|
await self._handle_response(ctx, "An error occurred while enabling the database. Please check the logs for details.")
|
||||||
await ctx.send("An error occurred while enabling the database. Please check the logs for details.")
|
|
||||||
|
|
||||||
@archivedb.command(name="disable")
|
@archivedb.command(name="disable")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -144,7 +173,7 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "use_database"
|
ctx.guild.id, "use_database"
|
||||||
)
|
)
|
||||||
if not current_setting:
|
if not current_setting:
|
||||||
await ctx.send("The video archive database is already disabled.")
|
await self._handle_response(ctx, "The video archive database is already disabled.")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Remove database references
|
# Remove database references
|
||||||
@@ -155,11 +184,11 @@ class VideoArchiver(GroupCog):
|
|||||||
await self.config_manager.update_setting(
|
await self.config_manager.update_setting(
|
||||||
ctx.guild.id, "use_database", False
|
ctx.guild.id, "use_database", False
|
||||||
)
|
)
|
||||||
await ctx.send("Video archive database has been disabled.")
|
await self._handle_response(ctx, "Video archive database has been disabled.")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error disabling database: {e}")
|
logger.error(f"Error disabling database: {e}")
|
||||||
await ctx.send("An error occurred while disabling the database.")
|
await self._handle_response(ctx, "An error occurred while disabling the database.")
|
||||||
|
|
||||||
@hybrid_command()
|
@hybrid_command()
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -168,7 +197,8 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Check if a video URL has been archived and get its Discord link if it exists."""
|
"""Check if a video URL has been archived and get its Discord link if it exists."""
|
||||||
try:
|
try:
|
||||||
if not self.db:
|
if not self.db:
|
||||||
await ctx.send(
|
await self._handle_response(
|
||||||
|
ctx,
|
||||||
"The archive database is not enabled. Ask an admin to enable it with `/archivedb enable`"
|
"The archive database is not enabled. Ask an admin to enable it with `/archivedb enable`"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
@@ -182,24 +212,24 @@ class VideoArchiver(GroupCog):
|
|||||||
color=discord.Color.green(),
|
color=discord.Color.green(),
|
||||||
)
|
)
|
||||||
embed.add_field(name="Archived Link", value=discord_url)
|
embed.add_field(name="Archived Link", value=discord_url)
|
||||||
await ctx.send(embed=embed)
|
await self._handle_response(ctx, embed=embed)
|
||||||
else:
|
else:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="Video Not Found",
|
title="Video Not Found",
|
||||||
description="This video has not been archived yet.",
|
description="This video has not been archived yet.",
|
||||||
color=discord.Color.red(),
|
color=discord.Color.red(),
|
||||||
)
|
)
|
||||||
await ctx.send(embed=embed)
|
await self._handle_response(ctx, embed=embed)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error checking archived video: {e}")
|
logger.error(f"Error checking archived video: {e}")
|
||||||
await ctx.send("An error occurred while checking the archive.")
|
await self._handle_response(ctx, "An error occurred while checking the archive.")
|
||||||
|
|
||||||
@hybrid_group(name="archiver", fallback="help")
|
@hybrid_group(name="archiver", fallback="help")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
async def archiver(self, ctx: Context):
|
async def archiver(self, ctx: Context):
|
||||||
"""Manage video archiver settings."""
|
"""Manage video archiver settings."""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
await ctx.send_help(ctx.command)
|
await self._handle_response(ctx, "Use `/help archiver` for a list of commands.")
|
||||||
|
|
||||||
@archiver.command(name="enable")
|
@archiver.command(name="enable")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -211,15 +241,15 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "enabled"
|
ctx.guild.id, "enabled"
|
||||||
)
|
)
|
||||||
if current_setting:
|
if current_setting:
|
||||||
await ctx.send("Video archiving is already enabled.")
|
await self._handle_response(ctx, "Video archiving is already enabled.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "enabled", True)
|
await self.config_manager.update_setting(ctx.guild.id, "enabled", True)
|
||||||
await ctx.send("Video archiving has been enabled.")
|
await self._handle_response(ctx, "Video archiving has been enabled.")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error enabling archiver: {e}")
|
logger.error(f"Error enabling archiver: {e}")
|
||||||
await ctx.send("An error occurred while enabling video archiving.")
|
await self._handle_response(ctx, "An error occurred while enabling video archiving.")
|
||||||
|
|
||||||
@archiver.command(name="disable")
|
@archiver.command(name="disable")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -231,15 +261,15 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "enabled"
|
ctx.guild.id, "enabled"
|
||||||
)
|
)
|
||||||
if not current_setting:
|
if not current_setting:
|
||||||
await ctx.send("Video archiving is already disabled.")
|
await self._handle_response(ctx, "Video archiving is already disabled.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "enabled", False)
|
await self.config_manager.update_setting(ctx.guild.id, "enabled", False)
|
||||||
await ctx.send("Video archiving has been disabled.")
|
await self._handle_response(ctx, "Video archiving has been disabled.")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error disabling archiver: {e}")
|
logger.error(f"Error disabling archiver: {e}")
|
||||||
await ctx.send("An error occurred while disabling video archiving.")
|
await self._handle_response(ctx, "An error occurred while disabling video archiving.")
|
||||||
|
|
||||||
@archiver.command(name="setchannel")
|
@archiver.command(name="setchannel")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -251,10 +281,10 @@ class VideoArchiver(GroupCog):
|
|||||||
await self.config_manager.update_setting(
|
await self.config_manager.update_setting(
|
||||||
ctx.guild.id, "archive_channel", channel.id
|
ctx.guild.id, "archive_channel", channel.id
|
||||||
)
|
)
|
||||||
await ctx.send(f"Archive channel has been set to {channel.mention}.")
|
await self._handle_response(ctx, f"Archive channel has been set to {channel.mention}.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting archive channel: {e}")
|
logger.error(f"Error setting archive channel: {e}")
|
||||||
await ctx.send("An error occurred while setting the archive channel.")
|
await self._handle_response(ctx, "An error occurred while setting the archive channel.")
|
||||||
|
|
||||||
@archiver.command(name="setlog")
|
@archiver.command(name="setlog")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -266,10 +296,10 @@ class VideoArchiver(GroupCog):
|
|||||||
await self.config_manager.update_setting(
|
await self.config_manager.update_setting(
|
||||||
ctx.guild.id, "log_channel", channel.id
|
ctx.guild.id, "log_channel", channel.id
|
||||||
)
|
)
|
||||||
await ctx.send(f"Log channel has been set to {channel.mention}.")
|
await self._handle_response(ctx, f"Log channel has been set to {channel.mention}.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting log channel: {e}")
|
logger.error(f"Error setting log channel: {e}")
|
||||||
await ctx.send("An error occurred while setting the log channel.")
|
await self._handle_response(ctx, "An error occurred while setting the log channel.")
|
||||||
|
|
||||||
@archiver.command(name="addchannel")
|
@archiver.command(name="addchannel")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -282,17 +312,17 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "enabled_channels"
|
ctx.guild.id, "enabled_channels"
|
||||||
)
|
)
|
||||||
if channel.id in enabled_channels:
|
if channel.id in enabled_channels:
|
||||||
await ctx.send(f"{channel.mention} is already being monitored.")
|
await self._handle_response(ctx, f"{channel.mention} is already being monitored.")
|
||||||
return
|
return
|
||||||
|
|
||||||
enabled_channels.append(channel.id)
|
enabled_channels.append(channel.id)
|
||||||
await self.config_manager.update_setting(
|
await self.config_manager.update_setting(
|
||||||
ctx.guild.id, "enabled_channels", enabled_channels
|
ctx.guild.id, "enabled_channels", enabled_channels
|
||||||
)
|
)
|
||||||
await ctx.send(f"Now monitoring {channel.mention} for videos.")
|
await self._handle_response(ctx, f"Now monitoring {channel.mention} for videos.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error adding enabled channel: {e}")
|
logger.error(f"Error adding enabled channel: {e}")
|
||||||
await ctx.send("An error occurred while adding the channel.")
|
await self._handle_response(ctx, "An error occurred while adding the channel.")
|
||||||
|
|
||||||
@archiver.command(name="removechannel")
|
@archiver.command(name="removechannel")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -305,17 +335,17 @@ class VideoArchiver(GroupCog):
|
|||||||
ctx.guild.id, "enabled_channels"
|
ctx.guild.id, "enabled_channels"
|
||||||
)
|
)
|
||||||
if channel.id not in enabled_channels:
|
if channel.id not in enabled_channels:
|
||||||
await ctx.send(f"{channel.mention} is not being monitored.")
|
await self._handle_response(ctx, f"{channel.mention} is not being monitored.")
|
||||||
return
|
return
|
||||||
|
|
||||||
enabled_channels.remove(channel.id)
|
enabled_channels.remove(channel.id)
|
||||||
await self.config_manager.update_setting(
|
await self.config_manager.update_setting(
|
||||||
ctx.guild.id, "enabled_channels", enabled_channels
|
ctx.guild.id, "enabled_channels", enabled_channels
|
||||||
)
|
)
|
||||||
await ctx.send(f"Stopped monitoring {channel.mention} for videos.")
|
await self._handle_response(ctx, f"Stopped monitoring {channel.mention} for videos.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error removing enabled channel: {e}")
|
logger.error(f"Error removing enabled channel: {e}")
|
||||||
await ctx.send("An error occurred while removing the channel.")
|
await self._handle_response(ctx, "An error occurred while removing the channel.")
|
||||||
|
|
||||||
@archiver.command(name="setformat")
|
@archiver.command(name="setformat")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -326,14 +356,14 @@ class VideoArchiver(GroupCog):
|
|||||||
try:
|
try:
|
||||||
format = format.lower()
|
format = format.lower()
|
||||||
if format not in ["mp4", "webm", "mkv"]:
|
if format not in ["mp4", "webm", "mkv"]:
|
||||||
await ctx.send("Invalid format. Please use mp4, webm, or mkv.")
|
await self._handle_response(ctx, "Invalid format. Please use mp4, webm, or mkv.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "video_format", format)
|
await self.config_manager.update_setting(ctx.guild.id, "video_format", format)
|
||||||
await ctx.send(f"Video format has been set to {format}.")
|
await self._handle_response(ctx, f"Video format has been set to {format}.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting video format: {e}")
|
logger.error(f"Error setting video format: {e}")
|
||||||
await ctx.send("An error occurred while setting the video format.")
|
await self._handle_response(ctx, "An error occurred while setting the video format.")
|
||||||
|
|
||||||
@archiver.command(name="setquality")
|
@archiver.command(name="setquality")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -343,14 +373,14 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Set the video quality for archived videos."""
|
"""Set the video quality for archived videos."""
|
||||||
try:
|
try:
|
||||||
if not 144 <= quality <= 4320:
|
if not 144 <= quality <= 4320:
|
||||||
await ctx.send("Quality must be between 144 and 4320.")
|
await self._handle_response(ctx, "Quality must be between 144 and 4320.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "video_quality", quality)
|
await self.config_manager.update_setting(ctx.guild.id, "video_quality", quality)
|
||||||
await ctx.send(f"Video quality has been set to {quality}p.")
|
await self._handle_response(ctx, f"Video quality has been set to {quality}p.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting video quality: {e}")
|
logger.error(f"Error setting video quality: {e}")
|
||||||
await ctx.send("An error occurred while setting the video quality.")
|
await self._handle_response(ctx, "An error occurred while setting the video quality.")
|
||||||
|
|
||||||
@archiver.command(name="setmaxsize")
|
@archiver.command(name="setmaxsize")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -360,14 +390,14 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Set the maximum file size for archived videos."""
|
"""Set the maximum file size for archived videos."""
|
||||||
try:
|
try:
|
||||||
if not 1 <= size <= 100:
|
if not 1 <= size <= 100:
|
||||||
await ctx.send("Size must be between 1 and 100 MB.")
|
await self._handle_response(ctx, "Size must be between 1 and 100 MB.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "max_file_size", size)
|
await self.config_manager.update_setting(ctx.guild.id, "max_file_size", size)
|
||||||
await ctx.send(f"Maximum file size has been set to {size}MB.")
|
await self._handle_response(ctx, f"Maximum file size has been set to {size}MB.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting max file size: {e}")
|
logger.error(f"Error setting max file size: {e}")
|
||||||
await ctx.send("An error occurred while setting the maximum file size.")
|
await self._handle_response(ctx, "An error occurred while setting the maximum file size.")
|
||||||
|
|
||||||
@archiver.command(name="setmessageduration")
|
@archiver.command(name="setmessageduration")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -377,14 +407,14 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Set how long to keep archived messages."""
|
"""Set how long to keep archived messages."""
|
||||||
try:
|
try:
|
||||||
if not 0 <= hours <= 168:
|
if not 0 <= hours <= 168:
|
||||||
await ctx.send("Duration must be between 0 and 168 hours (1 week).")
|
await self._handle_response(ctx, "Duration must be between 0 and 168 hours (1 week).")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "message_duration", hours)
|
await self.config_manager.update_setting(ctx.guild.id, "message_duration", hours)
|
||||||
await ctx.send(f"Message duration has been set to {hours} hours.")
|
await self._handle_response(ctx, f"Message duration has been set to {hours} hours.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting message duration: {e}")
|
logger.error(f"Error setting message duration: {e}")
|
||||||
await ctx.send("An error occurred while setting the message duration.")
|
await self._handle_response(ctx, "An error occurred while setting the message duration.")
|
||||||
|
|
||||||
@archiver.command(name="settemplate")
|
@archiver.command(name="settemplate")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -393,15 +423,22 @@ class VideoArchiver(GroupCog):
|
|||||||
async def set_message_template(self, ctx: Context, *, template: str):
|
async def set_message_template(self, ctx: Context, *, template: str):
|
||||||
"""Set the template for archived messages. Use {author}, {channel}, and {original_message} as placeholders."""
|
"""Set the template for archived messages. Use {author}, {channel}, and {original_message} as placeholders."""
|
||||||
try:
|
try:
|
||||||
if not any(ph in template for ph in ["{author}", "{channel}", "{original_message}"]):
|
if not any(
|
||||||
await ctx.send("Template must include at least one placeholder: {author}, {channel}, or {original_message}")
|
ph in template for ph in ["{author}", "{channel}", "{original_message}"]
|
||||||
|
):
|
||||||
|
await self._handle_response(
|
||||||
|
ctx,
|
||||||
|
"Template must include at least one placeholder: {author}, {channel}, or {original_message}"
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "message_template", template)
|
await self.config_manager.update_setting(
|
||||||
await ctx.send(f"Message template has been set to: {template}")
|
ctx.guild.id, "message_template", template
|
||||||
|
)
|
||||||
|
await self._handle_response(ctx, f"Message template has been set to: {template}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting message template: {e}")
|
logger.error(f"Error setting message template: {e}")
|
||||||
await ctx.send("An error occurred while setting the message template.")
|
await self._handle_response(ctx, "An error occurred while setting the message template.")
|
||||||
|
|
||||||
@archiver.command(name="setconcurrent")
|
@archiver.command(name="setconcurrent")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -411,14 +448,16 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Set the number of concurrent downloads allowed."""
|
"""Set the number of concurrent downloads allowed."""
|
||||||
try:
|
try:
|
||||||
if not 1 <= count <= 5:
|
if not 1 <= count <= 5:
|
||||||
await ctx.send("Concurrent downloads must be between 1 and 5.")
|
await self._handle_response(ctx, "Concurrent downloads must be between 1 and 5.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.config_manager.update_setting(ctx.guild.id, "concurrent_downloads", count)
|
await self.config_manager.update_setting(
|
||||||
await ctx.send(f"Concurrent downloads has been set to {count}.")
|
ctx.guild.id, "concurrent_downloads", count
|
||||||
|
)
|
||||||
|
await self._handle_response(ctx, f"Concurrent downloads has been set to {count}.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error setting concurrent downloads: {e}")
|
logger.error(f"Error setting concurrent downloads: {e}")
|
||||||
await ctx.send("An error occurred while setting concurrent downloads.")
|
await self._handle_response(ctx, "An error occurred while setting concurrent downloads.")
|
||||||
|
|
||||||
@archiver.command(name="settings")
|
@archiver.command(name="settings")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -426,10 +465,10 @@ class VideoArchiver(GroupCog):
|
|||||||
"""Show current archiver settings."""
|
"""Show current archiver settings."""
|
||||||
try:
|
try:
|
||||||
embed = await self.config_manager.format_settings_embed(ctx.guild)
|
embed = await self.config_manager.format_settings_embed(ctx.guild)
|
||||||
await ctx.send(embed=embed)
|
await self._handle_response(ctx, embed=embed)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error showing settings: {e}")
|
logger.error(f"Error showing settings: {e}")
|
||||||
await ctx.send("An error occurred while showing settings.")
|
await self._handle_response(ctx, "An error occurred while showing settings.")
|
||||||
|
|
||||||
@archiver.command(name="queue")
|
@archiver.command(name="queue")
|
||||||
@guild_only()
|
@guild_only()
|
||||||
@@ -462,12 +501,13 @@ class VideoArchiver(GroupCog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if error_msg:
|
if error_msg:
|
||||||
await ctx.send(error_msg)
|
await self._handle_response(ctx, error_msg)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error handling command error: {str(e)}")
|
logger.error(f"Error handling command error: {str(e)}")
|
||||||
try:
|
try:
|
||||||
await ctx.send(
|
await self._handle_response(
|
||||||
|
ctx,
|
||||||
"❌ An error occurred while handling another error. Please check the logs."
|
"❌ An error occurred while handling another error. Please check the logs."
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user