refactor: Convert commands to unique hybrid commands

- Reorganized commands into logical groups with unique prefixes:
  - va_: Core video archiver commands
  - vaq_: Queue management commands
  - vac_: Channel configuration commands
  - var_: Role management commands
  - vas_: Site management commands
- Updated all commands to be hybrid commands
- Updated README to reflect new command structure
- Maintained all existing functionality and parameters
This commit is contained in:
pacnpal
2024-11-15 01:47:57 +00:00
parent 8822c85b6f
commit 7e4b33dd55
2 changed files with 103 additions and 108 deletions

View File

@@ -45,43 +45,40 @@ A powerful video archiving cog that automatically downloads and reposts videos f
## Commands ## Commands
All commands support both prefix (`[p]videoarchiver` or `[p]va`) and slash command (`/videoarchiver`) syntax: All commands support both prefix and slash command syntax:
### Core Settings ### Core Video Archiver Commands (va_)
- **`setchannel <channel>`**: Set the archive channel - **`va_settings`**: Show current video archiver settings
- **`setnotification <channel>`**: Set the notification channel - **`va_format <mp4|webm>`**: Set video format
- **`setlogchannel <channel>`**: Set the log channel for errors - **`va_quality <144-4320>`**: Set maximum video quality (in pixels)
- **`setformat <mp4|webm>`**: Set video format - **`va_maxsize <1-100>`**: Set maximum file size (in MB)
- **`setquality <144-4320>`**: Set maximum video quality (in pixels) - **`va_concurrent <1-5>`**: Set number of concurrent downloads
- **`setmaxsize <1-100>`**: Set maximum file size (in MB) - **`va_toggledelete`**: Toggle deletion of local files after reposting
- **`setconcurrent <1-5>`**: Set number of concurrent downloads - **`va_duration <0-720>`**: Set message duration in hours (0 for permanent)
- **`va_template <template>`**: Set message template using {author}, {url}, {original_message}
- **`va_update`**: Update yt-dlp to latest version
- **`va_toggleupdates`**: Toggle update notifications
### Channel Monitoring ### Queue Management Commands (vaq_)
- **`addmonitor [channel]`**: Add channel to monitor (empty for all channels) - **`vaq_status`**: Show current queue status with basic metrics
- **`removemonitor <channel>`**: Remove channel from monitoring - **`vaq_metrics`**: Show detailed queue performance metrics
- **`toggledelete`**: Toggle deletion of local files after reposting - **`vaq_clear`**: Clear the video processing queue
### Message Configuration ### Channel Configuration Commands (vac_)
- **`setduration <0-720>`**: Set message duration in hours (0 for permanent) - **`vac_archive <channel>`**: Set the archive channel
- **`settemplate <template>`**: Set message template using {author}, {url}, {original_message} - **`vac_notify <channel>`**: Set the notification channel
- **`vac_log <channel>`**: Set the log channel for errors
- **`vac_monitor [channel]`**: Add channel to monitor (empty for all channels)
- **`vac_unmonitor <channel>`**: Remove channel from monitoring
### Role Management ### Role Management Commands (var_)
- **`addrole [role]`**: Add allowed role (empty for @everyone) - **`var_add [role]`**: Add allowed role (empty for @everyone)
- **`removerole <role>`**: Remove allowed role - **`var_remove <role>`**: Remove allowed role
- **`listroles`**: List allowed roles - **`var_list`**: List allowed roles
### Site Management ### Site Management Commands (vas_)
- **`enablesites [sites...]`**: Enable specific sites (empty for all) - **`vas_enable [sites...]`**: Enable specific sites (empty for all)
- **`listsites`**: List available and enabled sites - **`vas_list`**: List available and enabled sites
### Queue Management
- **`queue`**: Show current queue status with basic metrics
- **`queuemetrics`**: Show detailed queue performance metrics
- **`clearqueue`**: Clear the video processing queue
### System Management
- **`updateytdlp`**: Update yt-dlp to latest version
- **`toggleupdates`**: Toggle update notifications
## Queue System ## Queue System
@@ -115,7 +112,7 @@ Source: {original_message}
## Site Support ## Site Support
The cog supports all sites compatible with yt-dlp. Use `[p]va listsites` to see available sites and currently enabled ones. The cog supports all sites compatible with yt-dlp. Use `vas_list` to see available sites and currently enabled ones.
## Performance ## Performance

View File

@@ -5,6 +5,7 @@ from typing import Optional, Literal
import yt_dlp import yt_dlp
from datetime import datetime from datetime import datetime
class VideoArchiverCommands(commands.Cog): class VideoArchiverCommands(commands.Cog):
"""Command handler for VideoArchiver""" """Command handler for VideoArchiver"""
@@ -15,36 +16,37 @@ class VideoArchiverCommands(commands.Cog):
self.processor = processor self.processor = processor
super().__init__() super().__init__()
@commands.hybrid_group(name="videoarchiver", aliases=["va"], fallback="settings") # Core Video Archiver Commands
@commands.hybrid_command(name="va_settings")
@app_commands.guild_only() @app_commands.guild_only()
@commands.admin_or_permissions(administrator=True) @commands.admin_or_permissions(administrator=True)
async def videoarchiver(self, ctx: commands.Context): async def va_settings(self, ctx: commands.Context):
"""Video Archiver configuration commands""" """Show current video archiver settings"""
if ctx.invoked_subcommand is None: embed = await self.config.format_settings_embed(ctx.guild)
embed = await self.config.format_settings_embed(ctx.guild) await ctx.send(embed=embed)
await ctx.send(embed=embed)
@videoarchiver.command(name="updateytdlp") @commands.hybrid_command(name="va_update")
@app_commands.guild_only() @app_commands.guild_only()
@checks.is_owner() @checks.is_owner()
async def update_ytdlp(self, ctx: commands.Context): async def va_update(self, ctx: commands.Context):
"""Update yt-dlp to the latest version""" """Update yt-dlp to the latest version"""
success, message = await self.update_checker.update_yt_dlp() success, message = await self.update_checker.update_yt_dlp()
await ctx.send("" + message if success else "" + message) await ctx.send("" + message if success else "" + message)
@videoarchiver.command(name="toggleupdates") @commands.hybrid_command(name="va_toggleupdates")
@app_commands.guild_only() @app_commands.guild_only()
@commands.admin_or_permissions(administrator=True) @commands.admin_or_permissions(administrator=True)
async def toggle_update_check(self, ctx: commands.Context): async def va_toggleupdates(self, ctx: commands.Context):
"""Toggle yt-dlp update notifications""" """Toggle yt-dlp update notifications"""
state = await self.config.toggle_setting(ctx.guild.id, "disable_update_check") state = await self.config.toggle_setting(ctx.guild.id, "disable_update_check")
status = "disabled" if state else "enabled" status = "disabled" if state else "enabled"
await ctx.send(f"Update notifications {status}") await ctx.send(f"Update notifications {status}")
@videoarchiver.command(name="addrole") # Role Management Commands
@commands.hybrid_command(name="var_add")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(role="The role to allow (leave empty for @everyone)") @app_commands.describe(role="The role to allow (leave empty for @everyone)")
async def add_allowed_role(self, ctx: commands.Context, role: Optional[discord.Role] = None): async def var_add(self, ctx: commands.Context, role: Optional[discord.Role] = None):
"""Add a role that's allowed to trigger archiving""" """Add a role that's allowed to trigger archiving"""
if not role: if not role:
# If no role is specified, clear the list to allow everyone # If no role is specified, clear the list to allow everyone
@@ -55,23 +57,21 @@ class VideoArchiverCommands(commands.Cog):
await self.config.add_to_list(ctx.guild.id, "allowed_roles", role.id) await self.config.add_to_list(ctx.guild.id, "allowed_roles", role.id)
await ctx.send(f"Added {role.name} to allowed roles") await ctx.send(f"Added {role.name} to allowed roles")
@videoarchiver.command(name="removerole") @commands.hybrid_command(name="var_remove")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(role="The role to remove") @app_commands.describe(role="The role to remove")
async def remove_allowed_role(self, ctx: commands.Context, role: discord.Role): async def var_remove(self, ctx: commands.Context, role: discord.Role):
"""Remove a role from allowed roles""" """Remove a role from allowed roles"""
await self.config.remove_from_list(ctx.guild.id, "allowed_roles", role.id) await self.config.remove_from_list(ctx.guild.id, "allowed_roles", role.id)
await ctx.send(f"Removed {role.name} from allowed roles") await ctx.send(f"Removed {role.name} from allowed roles")
@videoarchiver.command(name="listroles") @commands.hybrid_command(name="var_list")
@app_commands.guild_only() @app_commands.guild_only()
async def list_allowed_roles(self, ctx: commands.Context): async def var_list(self, ctx: commands.Context):
"""List all roles allowed to trigger archiving""" """List all roles allowed to trigger archiving"""
roles = await self.config.get_setting(ctx.guild.id, "allowed_roles") roles = await self.config.get_setting(ctx.guild.id, "allowed_roles")
if not roles: if not roles:
await ctx.send( await ctx.send("No roles are currently set (all users can trigger archiving)")
"No roles are currently set (all users can trigger archiving)"
)
return return
role_names = [ role_names = [
r.name if r else "@everyone" r.name if r else "@everyone"
@@ -79,44 +79,43 @@ class VideoArchiverCommands(commands.Cog):
] ]
await ctx.send(f"Allowed roles: {', '.join(role_names)}") await ctx.send(f"Allowed roles: {', '.join(role_names)}")
@videoarchiver.command(name="setconcurrent") @commands.hybrid_command(name="va_concurrent")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(count="Number of concurrent downloads (1-5)") @app_commands.describe(count="Number of concurrent downloads (1-5)")
async def set_concurrent_downloads(self, ctx: commands.Context, count: app_commands.Range[int, 1, 5]): async def va_concurrent(self, ctx: commands.Context, count: app_commands.Range[int, 1, 5]):
"""Set the number of concurrent downloads""" """Set the number of concurrent downloads"""
await self.config.update_setting(ctx.guild.id, "concurrent_downloads", count) await self.config.update_setting(ctx.guild.id, "concurrent_downloads", count)
await ctx.send(f"Concurrent downloads set to {count}") await ctx.send(f"Concurrent downloads set to {count}")
@videoarchiver.command(name="setchannel") # Channel Configuration Commands
@commands.hybrid_command(name="vac_archive")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(channel="The archive channel") @app_commands.describe(channel="The archive channel")
async def set_archive_channel(self, ctx: commands.Context, channel: discord.TextChannel): async def vac_archive(self, ctx: commands.Context, channel: discord.TextChannel):
"""Set the archive channel""" """Set the archive channel"""
await self.config.update_setting(ctx.guild.id, "archive_channel", channel.id) await self.config.update_setting(ctx.guild.id, "archive_channel", channel.id)
await ctx.send(f"Archive channel set to {channel.mention}") await ctx.send(f"Archive channel set to {channel.mention}")
@videoarchiver.command(name="setnotification") @commands.hybrid_command(name="vac_notify")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(channel="The notification channel") @app_commands.describe(channel="The notification channel")
async def set_notification_channel(self, ctx: commands.Context, channel: discord.TextChannel): async def vac_notify(self, ctx: commands.Context, channel: discord.TextChannel):
"""Set the notification channel (where archive messages appear)""" """Set the notification channel (where archive messages appear)"""
await self.config.update_setting( await self.config.update_setting(ctx.guild.id, "notification_channel", channel.id)
ctx.guild.id, "notification_channel", channel.id
)
await ctx.send(f"Notification channel set to {channel.mention}") await ctx.send(f"Notification channel set to {channel.mention}")
@videoarchiver.command(name="setlogchannel") @commands.hybrid_command(name="vac_log")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(channel="The log channel") @app_commands.describe(channel="The log channel")
async def set_log_channel(self, ctx: commands.Context, channel: discord.TextChannel): async def vac_log(self, ctx: commands.Context, channel: discord.TextChannel):
"""Set the log channel for error messages and notifications""" """Set the log channel for error messages and notifications"""
await self.config.update_setting(ctx.guild.id, "log_channel", channel.id) await self.config.update_setting(ctx.guild.id, "log_channel", channel.id)
await ctx.send(f"Log channel set to {channel.mention}") await ctx.send(f"Log channel set to {channel.mention}")
@videoarchiver.command(name="addmonitor") @commands.hybrid_command(name="vac_monitor")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(channel="The channel to monitor (leave empty to monitor all channels)") @app_commands.describe(channel="The channel to monitor (leave empty to monitor all channels)")
async def add_monitored_channel(self, ctx: commands.Context, channel: Optional[discord.TextChannel] = None): async def vac_monitor(self, ctx: commands.Context, channel: Optional[discord.TextChannel] = None):
"""Add a channel to monitor for videos""" """Add a channel to monitor for videos"""
if not channel: if not channel:
# If no channel is specified, clear the list to monitor all channels # If no channel is specified, clear the list to monitor all channels
@@ -127,67 +126,67 @@ class VideoArchiverCommands(commands.Cog):
await self.config.add_to_list(ctx.guild.id, "monitored_channels", channel.id) await self.config.add_to_list(ctx.guild.id, "monitored_channels", channel.id)
await ctx.send(f"Now monitoring {channel.mention} for videos") await ctx.send(f"Now monitoring {channel.mention} for videos")
@videoarchiver.command(name="removemonitor") @commands.hybrid_command(name="vac_unmonitor")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(channel="The channel to stop monitoring") @app_commands.describe(channel="The channel to stop monitoring")
async def remove_monitored_channel(self, ctx: commands.Context, channel: discord.TextChannel): async def vac_unmonitor(self, ctx: commands.Context, channel: discord.TextChannel):
"""Remove a channel from monitoring""" """Remove a channel from monitoring"""
await self.config.remove_from_list( await self.config.remove_from_list(ctx.guild.id, "monitored_channels", channel.id)
ctx.guild.id, "monitored_channels", channel.id
)
await ctx.send(f"Stopped monitoring {channel.mention}") await ctx.send(f"Stopped monitoring {channel.mention}")
@videoarchiver.command(name="setformat") # Video Format Commands
@commands.hybrid_command(name="va_format")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(format="The video format (e.g., mp4, webm)") @app_commands.describe(format="The video format (e.g., mp4, webm)")
async def set_video_format(self, ctx: commands.Context, format: Literal["mp4", "webm"]): async def va_format(self, ctx: commands.Context, format: Literal["mp4", "webm"]):
"""Set the video format""" """Set the video format"""
await self.config.update_setting(ctx.guild.id, "video_format", format.lower()) await self.config.update_setting(ctx.guild.id, "video_format", format.lower())
await ctx.send(f"Video format set to {format.lower()}") await ctx.send(f"Video format set to {format.lower()}")
@videoarchiver.command(name="setquality") @commands.hybrid_command(name="va_quality")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(quality="Maximum video quality in pixels (e.g., 1080)") @app_commands.describe(quality="Maximum video quality in pixels (e.g., 1080)")
async def set_video_quality(self, ctx: commands.Context, quality: app_commands.Range[int, 144, 4320]): async def va_quality(self, ctx: commands.Context, quality: app_commands.Range[int, 144, 4320]):
"""Set the maximum video quality""" """Set the maximum video quality"""
await self.config.update_setting(ctx.guild.id, "video_quality", quality) await self.config.update_setting(ctx.guild.id, "video_quality", quality)
await ctx.send(f"Maximum video quality set to {quality}p") await ctx.send(f"Maximum video quality set to {quality}p")
@videoarchiver.command(name="setmaxsize") @commands.hybrid_command(name="va_maxsize")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(size="Maximum file size in MB") @app_commands.describe(size="Maximum file size in MB")
async def set_max_file_size(self, ctx: commands.Context, size: app_commands.Range[int, 1, 100]): async def va_maxsize(self, ctx: commands.Context, size: app_commands.Range[int, 1, 100]):
"""Set the maximum file size""" """Set the maximum file size"""
await self.config.update_setting(ctx.guild.id, "max_file_size", size) await self.config.update_setting(ctx.guild.id, "max_file_size", size)
await ctx.send(f"Maximum file size set to {size}MB") await ctx.send(f"Maximum file size set to {size}MB")
@videoarchiver.command(name="toggledelete") @commands.hybrid_command(name="va_toggledelete")
@app_commands.guild_only() @app_commands.guild_only()
async def toggle_delete_after_repost(self, ctx: commands.Context): async def va_toggledelete(self, ctx: commands.Context):
"""Toggle whether to delete local files after reposting""" """Toggle whether to delete local files after reposting"""
state = await self.config.toggle_setting(ctx.guild.id, "delete_after_repost") state = await self.config.toggle_setting(ctx.guild.id, "delete_after_repost")
await ctx.send(f"Delete after repost: {state}") await ctx.send(f"Delete after repost: {state}")
@videoarchiver.command(name="setduration") @commands.hybrid_command(name="va_duration")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(hours="Duration in hours (0 for permanent)") @app_commands.describe(hours="Duration in hours (0 for permanent)")
async def set_message_duration(self, ctx: commands.Context, hours: app_commands.Range[int, 0, 720]): async def va_duration(self, ctx: commands.Context, hours: app_commands.Range[int, 0, 720]):
"""Set how long to keep archive messages""" """Set how long to keep archive messages"""
await self.config.update_setting(ctx.guild.id, "message_duration", hours) await self.config.update_setting(ctx.guild.id, "message_duration", hours)
await ctx.send(f"Archive message duration set to {hours} hours") await ctx.send(f"Archive message duration set to {hours} hours")
@videoarchiver.command(name="settemplate") @commands.hybrid_command(name="va_template")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(template="Message template using {author}, {url}, and {original_message}") @app_commands.describe(template="Message template using {author}, {url}, and {original_message}")
async def set_message_template(self, ctx: commands.Context, template: str): async def va_template(self, ctx: commands.Context, template: str):
"""Set the archive message template""" """Set the archive message template"""
await self.config.update_setting(ctx.guild.id, "message_template", template) await self.config.update_setting(ctx.guild.id, "message_template", template)
await ctx.send(f"Archive message template set to:\n{template}") await ctx.send(f"Archive message template set to:\n{template}")
@videoarchiver.command(name="enablesites") # Site Management Commands
@commands.hybrid_command(name="vas_enable")
@app_commands.guild_only() @app_commands.guild_only()
@app_commands.describe(sites="Sites to enable (leave empty for all sites)") @app_commands.describe(sites="Sites to enable (leave empty for all sites)")
async def enable_sites(self, ctx: commands.Context, *, sites: Optional[str] = None): async def vas_enable(self, ctx: commands.Context, *, sites: Optional[str] = None):
"""Enable specific sites""" """Enable specific sites"""
if sites is None: if sites is None:
await self.config.update_setting(ctx.guild.id, "enabled_sites", []) await self.config.update_setting(ctx.guild.id, "enabled_sites", [])
@@ -209,15 +208,13 @@ class VideoArchiverCommands(commands.Cog):
await self.config.update_setting(ctx.guild.id, "enabled_sites", site_list) await self.config.update_setting(ctx.guild.id, "enabled_sites", site_list)
await ctx.send(f"Enabled sites: {', '.join(site_list)}") await ctx.send(f"Enabled sites: {', '.join(site_list)}")
@videoarchiver.command(name="listsites") @commands.hybrid_command(name="vas_list")
@app_commands.guild_only() @app_commands.guild_only()
async def list_sites(self, ctx: commands.Context): async def vas_list(self, ctx: commands.Context):
"""List all available sites and currently enabled sites""" """List all available sites and currently enabled sites"""
enabled_sites = await self.config.get_setting(ctx.guild.id, "enabled_sites") enabled_sites = await self.config.get_setting(ctx.guild.id, "enabled_sites")
embed = discord.Embed( embed = discord.Embed(title="Video Sites Configuration", color=discord.Color.blue())
title="Video Sites Configuration", color=discord.Color.blue()
)
with yt_dlp.YoutubeDL() as ydl: with yt_dlp.YoutubeDL() as ydl:
all_sites = sorted(ie.IE_NAME for ie in ydl._ies if ie.IE_NAME is not None) all_sites = sorted(ie.IE_NAME for ie in ydl._ies if ie.IE_NAME is not None)
@@ -243,17 +240,18 @@ class VideoArchiverCommands(commands.Cog):
await ctx.send(embed=embed) await ctx.send(embed=embed)
@videoarchiver.command(name="queue") # Queue Management Commands
@commands.hybrid_command(name="vaq_status")
@app_commands.guild_only() @app_commands.guild_only()
@commands.admin_or_permissions(administrator=True) @commands.admin_or_permissions(administrator=True)
async def show_queue(self, ctx: commands.Context): async def vaq_status(self, ctx: commands.Context):
"""Show current queue status with basic metrics""" """Show current queue status with basic metrics"""
status = self.processor.queue_manager.get_queue_status(ctx.guild.id) status = self.processor.queue_manager.get_queue_status(ctx.guild.id)
embed = discord.Embed( embed = discord.Embed(
title="Video Processing Queue Status", title="Video Processing Queue Status",
color=discord.Color.blue(), color=discord.Color.blue(),
timestamp=datetime.utcnow() timestamp=datetime.utcnow(),
) )
# Queue Status # Queue Status
@@ -265,35 +263,35 @@ class VideoArchiverCommands(commands.Cog):
f"✅ Completed: {status['completed']}\n" f"✅ Completed: {status['completed']}\n"
f"❌ Failed: {status['failed']}" f"❌ Failed: {status['failed']}"
), ),
inline=False inline=False,
) )
# Basic Metrics # Basic Metrics
metrics = status['metrics'] metrics = status["metrics"]
embed.add_field( embed.add_field(
name="Basic Metrics", name="Basic Metrics",
value=( value=(
f"Success Rate: {metrics['success_rate']:.1%}\n" f"Success Rate: {metrics['success_rate']:.1%}\n"
f"Avg Processing Time: {metrics['avg_processing_time']:.1f}s" f"Avg Processing Time: {metrics['avg_processing_time']:.1f}s"
), ),
inline=False inline=False,
) )
embed.set_footer(text="Use /videoarchiver queuemetrics for detailed performance metrics") embed.set_footer(text="Use /vaq_metrics for detailed performance metrics")
await ctx.send(embed=embed) await ctx.send(embed=embed)
@videoarchiver.command(name="queuemetrics") @commands.hybrid_command(name="vaq_metrics")
@app_commands.guild_only() @app_commands.guild_only()
@commands.admin_or_permissions(administrator=True) @commands.admin_or_permissions(administrator=True)
async def show_queue_metrics(self, ctx: commands.Context): async def vaq_metrics(self, ctx: commands.Context):
"""Show detailed queue performance metrics""" """Show detailed queue performance metrics"""
status = self.processor.queue_manager.get_queue_status(ctx.guild.id) status = self.processor.queue_manager.get_queue_status(ctx.guild.id)
metrics = status['metrics'] metrics = status["metrics"]
embed = discord.Embed( embed = discord.Embed(
title="Queue Performance Metrics", title="Queue Performance Metrics",
color=discord.Color.blue(), color=discord.Color.blue(),
timestamp=datetime.utcnow() timestamp=datetime.utcnow(),
) )
# Processing Statistics # Processing Statistics
@@ -305,7 +303,7 @@ class VideoArchiverCommands(commands.Cog):
f"Success Rate: {metrics['success_rate']:.1%}\n" f"Success Rate: {metrics['success_rate']:.1%}\n"
f"Avg Processing Time: {metrics['avg_processing_time']:.1f}s" f"Avg Processing Time: {metrics['avg_processing_time']:.1f}s"
), ),
inline=False inline=False,
) )
# Resource Usage # Resource Usage
@@ -315,7 +313,7 @@ class VideoArchiverCommands(commands.Cog):
f"Peak Memory Usage: {metrics['peak_memory_usage']:.1f}MB\n" f"Peak Memory Usage: {metrics['peak_memory_usage']:.1f}MB\n"
f"Last Cleanup: {metrics['last_cleanup']}" f"Last Cleanup: {metrics['last_cleanup']}"
), ),
inline=False inline=False,
) )
# Current Queue State # Current Queue State
@@ -327,16 +325,16 @@ class VideoArchiverCommands(commands.Cog):
f"✅ Completed: {status['completed']}\n" f"✅ Completed: {status['completed']}\n"
f"❌ Failed: {status['failed']}" f"❌ Failed: {status['failed']}"
), ),
inline=False inline=False,
) )
embed.set_footer(text="Metrics are updated in real-time as videos are processed") embed.set_footer(text="Metrics are updated in real-time as videos are processed")
await ctx.send(embed=embed) await ctx.send(embed=embed)
@videoarchiver.command(name="clearqueue") @commands.hybrid_command(name="vaq_clear")
@app_commands.guild_only() @app_commands.guild_only()
@commands.admin_or_permissions(administrator=True) @commands.admin_or_permissions(administrator=True)
async def clear_queue(self, ctx: commands.Context): async def vaq_clear(self, ctx: commands.Context):
"""Clear the video processing queue for this guild""" """Clear the video processing queue for this guild"""
cleared = await self.processor.queue_manager.clear_guild_queue(ctx.guild.id) cleared = await self.processor.queue_manager.clear_guild_queue(ctx.guild.id)
await ctx.send(f"Cleared {cleared} items from the queue") await ctx.send(f"Cleared {cleared} items from the queue")