fix: Properly implement slash commands - Use app_commands for slash command support - Add proper command group structure - Handle command registration and syncing

This commit is contained in:
pacnpal
2024-11-15 00:45:13 +00:00
parent cb1394f413
commit ba71081687
3 changed files with 162 additions and 153 deletions

View File

@@ -1,13 +1,12 @@
"""VideoArchiver cog for Red-DiscordBot"""
from redbot.core.bot import Red
from redbot.core.utils import get_end_user_data_statement
from .video_archiver import VideoArchiver
from videoarchiver.video_archiver import VideoArchiver
from videoarchiver.ffmpeg.ffmpeg_manager import FFmpegManager
from videoarchiver.ffmpeg.exceptions import FFmpegError, GPUError, DownloadError
__red_end_user_data_statement__ = get_end_user_data_statement(__file__)
async def setup(bot: Red):
await bot.add_cog(VideoArchiver(bot))
async def setup(bot: Red) -> None:
"""Load VideoArchiver."""
cog = VideoArchiver(bot)
await bot.add_cog(cog)
# Sync commands with Discord
if not hasattr(bot, "tree"):
return
await bot.tree.sync()