revert URL cleaning and update year on license
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 16s
All checks were successful
Garfbot CI/CD Deployment / Deploy (push) Successful in 16s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
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
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
|
||||
22
garfmain.py
22
garfmain.py
@@ -3,7 +3,7 @@ import config
|
||||
import asyncio
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from urllib.parse import urlparse, parse_qs, urlencode
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
|
||||
from garfpy import (
|
||||
help,
|
||||
@@ -183,18 +183,18 @@ async def on_message(message):
|
||||
content = message.content.strip()
|
||||
lower = content.lower()
|
||||
|
||||
# Remove tracking stuff from youtube and spotify links
|
||||
cleaned_urls = []
|
||||
# # Remove tracking stuff from youtube and spotify links
|
||||
# cleaned_urls = []
|
||||
|
||||
for pattern in URL_PATTERNS:
|
||||
for match in re.finditer(pattern, message.content):
|
||||
cleaned = clean_url(match.group(0))
|
||||
if cleaned and cleaned != match.group(0):
|
||||
cleaned_urls.append(cleaned)
|
||||
# for pattern in URL_PATTERNS:
|
||||
# for match in re.finditer(pattern, message.content):
|
||||
# cleaned = clean_url(match.group(0))
|
||||
# if cleaned and cleaned != match.group(0):
|
||||
# cleaned_urls.append(cleaned)
|
||||
|
||||
if cleaned_urls:
|
||||
links = '\n'.join(cleaned_urls)
|
||||
await message.reply(f"🔗 Cleaned link{'s' if len(cleaned_urls) > 1 else ''}:\n{links}")
|
||||
# if cleaned_urls:
|
||||
# links = '\n'.join(cleaned_urls)
|
||||
# await message.reply(f"🔗 Cleaned link{'s' if len(cleaned_urls) > 1 else ''}:\n{links}")
|
||||
|
||||
# Chats & pics
|
||||
if lower.startswith("hey garfield") or isinstance(
|
||||
|
||||
Reference in New Issue
Block a user