feat: stickers no longer count towards messages rankngs

This commit is contained in:
Krzysztof Rudnicki 2024-10-05 10:01:28 +02:00
parent ae2a16c47d
commit f1931b800c

View File

@ -5,8 +5,8 @@ import requests
import base64
import json
from datetime import datetime, time, timedelta
from rule34Py import rule34Py
r34Py = rule34Py()
# from rule34Py import rule34Py
# r34Py = rule34Py()
@ -123,7 +123,7 @@ def extract_source_uuid(message):
command_map = {
("!kot", "!koty", "!kots", "!cat", "!cats", "!meow", "!miau", "!ᴋᴏᴛ", "!𝓴𝓸𝓽", "!𝗸𝗼𝘁"): lambda recipient: send_image(fetch_and_download_image("https://api.thecatapi.com/v1/images/search", [0, 'url']), recipient),
("!pies", "!psy", "!dog", "!dogs", "!woof", "!szczek", "!𝗽𝗶𝗲𝘀", "!͓̽p͓̽i͓̽e͓̽s͓̽"): lambda recipient: send_image(fetch_and_download_image("https://dog.ceo/api/breeds/image/random", 'message'), recipient),
("!traps"): lambda recipient: send_image(download_image(((r34Py.random_post(["trap"])).sample)), recipient)
# ("!traps"): lambda recipient: send_image(download_image(((r34Py.random_post(["trap"])).sample)), recipient)
}
def extract_source_name(message):
@ -223,7 +223,7 @@ async def listen_to_server(counter):
print("message: ", message)
message_content = extract_message_content(message)
await send_to_group(message_content, counter, message)
if message_content.get('destinationNumber', {}) == PHONE_NUMBER:
if message_content.get('destinationNumber', {}) == PHONE_NUMBER and message_content.get('sticker') == None:
await count_messages(json.loads(message).get('envelope', {}), counter)
await trigger_command(message_content, PHONE_NUMBER)
except websockets.ConnectionClosed as e: