mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
Fixed the "cannot import name '_download_progress'" error by:
Adding a shared progress_tracker instance in processor/init.py Exposing public functions that wrap the ProgressTracker methods Removing direct access to private _download_progress variable Fixed the "'QueueItem' object has no attribute 'retry_count'" error by: Updating the QueueItem class in queue/models.py to use retry_count instead of retries This matches the field name used in the queue manager's implementation
This commit is contained in:
@@ -12,11 +12,37 @@ REACTIONS = {
|
||||
'processing': '⚙️',
|
||||
'success': '✅',
|
||||
'error': '❌',
|
||||
'archived': '🔄', # New reaction for already archived videos
|
||||
'numbers': ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣'],
|
||||
'progress': ['⬛', '🟨', '🟩'],
|
||||
'download': ['0️⃣', '2️⃣', '4️⃣', '6️⃣', '8️⃣', '🔟']
|
||||
}
|
||||
|
||||
async def handle_archived_reaction(message: discord.Message, user: discord.User, db) -> None:
|
||||
"""Handle reaction to archived video message"""
|
||||
try:
|
||||
# Check if the reaction is from a user (not the bot) and is the archived reaction
|
||||
if user.bot or str(message.reactions[0].emoji) != REACTIONS['archived']:
|
||||
return
|
||||
|
||||
# Extract URLs from the message
|
||||
urls = []
|
||||
if message.content:
|
||||
for word in message.content.split():
|
||||
if any(s in word.lower() for s in ['http://', 'https://']):
|
||||
urls.append(word)
|
||||
|
||||
# Check each URL in the database
|
||||
for url in urls:
|
||||
result = db.get_archived_video(url)
|
||||
if result:
|
||||
discord_url = result[0]
|
||||
await message.reply(f"This video was already archived. You can find it here: {discord_url}")
|
||||
return
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error handling archived reaction: {e}")
|
||||
|
||||
async def update_queue_position_reaction(message: discord.Message, position: int, bot_user) -> None:
|
||||
"""Update queue position reaction"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user