From ae2a16c47d63fe5a73b744c8b8c5b8d6e6cb644a Mon Sep 17 00:00:00 2001 From: Krzysztof Rudnicki Date: Tue, 24 Sep 2024 23:11:14 +0200 Subject: [PATCH] feat: traps are back 8) --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f4699e5..da9d0f2 100644 --- a/main.py +++ b/main.py @@ -5,7 +5,8 @@ import requests import base64 import json from datetime import datetime, time, timedelta -# from rule34py import rule34py +from rule34Py import rule34Py +r34Py = rule34Py() @@ -122,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_message("No traps for now, sorry πŸ˜”", recipient) + ("!traps"): lambda recipient: send_image(download_image(((r34Py.random_post(["trap"])).sample)), recipient) } def extract_source_name(message):