revert URL cleaning and update year on license
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 16s

This commit is contained in:
2026-03-14 22:50:23 -05:00
parent 940b6b80d9
commit bfef23eb72
2 changed files with 12 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
MIT No Attribution MIT No Attribution
Copyright 2025 Aaron Crate Copyright 2026 Aaron Crate
Permission is hereby granted, free of charge, to any person obtaining a copy of this Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software software and associated documentation files (the "Software"), to deal in the Software

View File

@@ -3,7 +3,7 @@ import config
import asyncio import asyncio
import discord import discord
from discord.ext import commands from discord.ext import commands
from urllib.parse import urlparse, parse_qs, urlencode from urllib.parse import urlparse, parse_qs
from garfpy import ( from garfpy import (
help, help,
@@ -183,18 +183,18 @@ async def on_message(message):
content = message.content.strip() content = message.content.strip()
lower = content.lower() lower = content.lower()
# Remove tracking stuff from youtube and spotify links # # Remove tracking stuff from youtube and spotify links
cleaned_urls = [] # cleaned_urls = []
for pattern in URL_PATTERNS: # for pattern in URL_PATTERNS:
for match in re.finditer(pattern, message.content): # for match in re.finditer(pattern, message.content):
cleaned = clean_url(match.group(0)) # cleaned = clean_url(match.group(0))
if cleaned and cleaned != match.group(0): # if cleaned and cleaned != match.group(0):
cleaned_urls.append(cleaned) # cleaned_urls.append(cleaned)
if cleaned_urls: # if cleaned_urls:
links = '\n'.join(cleaned_urls) # links = '\n'.join(cleaned_urls)
await message.reply(f"🔗 Cleaned link{'s' if len(cleaned_urls) > 1 else ''}:\n{links}") # await message.reply(f"🔗 Cleaned link{'s' if len(cleaned_urls) > 1 else ''}:\n{links}")
# Chats & pics # Chats & pics
if lower.startswith("hey garfield") or isinstance( if lower.startswith("hey garfield") or isinstance(