Skip to content

Commit

Permalink
Fix: blank regex.
Browse files Browse the repository at this point in the history
  • Loading branch information
remiliacn committed Dec 18, 2024
1 parent 06ae354 commit ca10cea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions constants/regex.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
WEBHOOK_REGEX = r"(https?:\/\/.*discord(app)?\.com\/api\/webhooks\/\d+\/.{68})"
WEBHOOK_REGEX_BASE64 = r"(aHR0cHM6Ly9[\d\w]+==)"
WEBHOOK_REGEX_BASE64 = r"(aHR0cHM6Ly9[A-Za-z0-9\-_]+={0,2})"
TELEGRAM_REGEX = r"([0-9]{10}:[a-zA-Z0-9]{35})"
TELEGRAM_REGEX_BASE64 = r"([MNZO][A-Za-z0-9+/=]{30,})\x00"
DISCORD_TOKEN_MATCHER = r"[MNZO]\w{25}\.\w{6}\.[A-Za-z0-9\-_]{38}"
DISCORD_TOKEN_MATCHER = r"[MNZO][A-Za-z0-9\-_]{25}\.[A-Za-z0-9\-_]{6}\.[A-Za-z0-9\-_]{38}"
8 changes: 4 additions & 4 deletions utils/webhook_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def validate_and_delete_webhook(webhook: str) -> bool:
logger.debug(f'Webhook status code: {webhook_status_code}')
if webhook_status_code <= 205:
logger.info(f"webhook: {webhook} is valid!")
result = delete(webhook, headers={"Content-Type": "application/json"})
logger.success(
f"Webhook {webhook} is retrieved successfully and deleted!! {result.status_code}"
)
# result = delete(webhook, headers={"Content-Type": "application/json"})
# logger.success(
# f"Webhook {webhook} is retrieved successfully and deleted!! {result.status_code}"
# )

return True

Expand Down

0 comments on commit ca10cea

Please sign in to comment.