Spaces:
Running
Running
import os | |
import requests | |
import random | |
import time | |
import logging | |
import threading | |
from fastapi import FastAPI | |
from dataclasses import dataclass, field | |
# Configuración de logging | |
logging.basicConfig( | |
level=logging.INFO, | |
format="%(asctime)s - %(levelname)s - %(message)s" | |
) | |
logger = logging.getLogger("DiscordLogger") | |
# Token y headers para la API de Discord | |
TOKEN = os.getenv("TOKEN") # Asegúrate de configurar la variable de entorno TOKEN | |
HEADERS = { | |
"User-Agent": "Mozilla/5.0", | |
"Accept": "*/*", | |
"Content-Type": "application/json", | |
"Authorization": TOKEN | |
} | |
# Listas por defecto de stickers y GIFs (puedes personalizarlos) | |
SANDRA_STICKER_IDS = [ | |
"1004733061377839155", "1069462756597714954", "1069464246276083783", | |
"1071961877590069329", "1135522478924496968", "1143089446959456266", | |
"1151968132378931341", "1167322137225342986", "1203740621668483112", | |
"1238703199091953725", "1240964158388961331", "1243564218741952663", | |
"1257957401236344915", "1260907231549980734", "1263109894807097404", | |
"1338763640630804490", "1338945320498888745" | |
] | |
SMASH_STICKERS_IDS = ["1275122399796531320", "1297373976481501236", "1297374313728446555", "1297374469744099368", "1297374773172502609", "1297375195337723904", "1299157034696179783", "1313635370059038725", "1325679489413550130", "1327084487603126323", "1328103130998505503", "1329330186612637706", "1330322740292354108", "1330592946613129286", "1333509212730298440", "1334940407296950355", "1338581218266185769", "1338766114863448085", "1339776105468395540", "1340047409430003782", "1340047616276172881", "1340821158399840357", "1341437725177286656", "1341909889789853748"] | |
SANDRA_GIF_URLS2 = [ | |
"https://media.discordapp.net/attachments/978373982011150369/981008116990771270/9C48BE6C-EA86-49CF-90DB-C07F58AAE464.gif?ex=67b7d881&is=67b68701&hm=5b3a233dafc4de52414bae4280cb644fda85e12430a30470d7b2b59c78605d5a&", | |
"https://media.discordapp.net/attachments/1304500459565744161/1306263414607450142/media-iv-text.gif?ex=67b7e3db&is=67b6925b&hm=88be547a870fa4dc2ced25b470c2324a87b7ed7d0bfe8158a426f289c7b7d312&", | |
"https://media.discordapp.net/attachments/753808274062573639/809190519594025050/arana.gif?ex=67b7ade5&is=67b65c65&hm=422e139b8d883a76476022acfdddf8cb9dd0492bbc775540b228f1479828590f&", | |
"https://cdn.discordapp.com/attachments/1334611383442083901/1334611429583618138/cd16102f-4f11-45a3-b34a-0ccf58e3f982.gif?ex=67b78740&is=67b635c0&hm=6b129cbfe287257f6f476c3bb696b2b5d15614e93bb722e42051e639c0011be0&", | |
"https://media.discordapp.net/attachments/1037060119881601195/1176932252559622204/voicemessage.gif?ex=67b76193&is=67b61013&hm=394a35f837da28653683cb229f2209deeed4a9d6aaba2441de88968a34103342&=", | |
"https://tenor.com/view/funny-gif-11026644638307910936", | |
"https://tenor.com/view/bee-gif-2221550446572997929", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1341925949138010173/PERDONAME_POR_TODO_ALISON.gif?ex=67b7c56e&is=67b673ee&hm=0f974f8d5888ef5732f9b0ebee9276466e4dce4c99b7cc959327b0758a577357&", | |
"https://tenor.com/view/cats-cat-cute-run-kitten-gif-14804766", | |
"https://tenor.com/view/ok-i-pull-up-gif-27257886", | |
"https://tenor.com/view/fat-cat-fatty-sleepy-sleepfat-gif-27064818", | |
"https://tenor.com/view/angry-cat-gif-25783770", | |
"https://tenor.com/view/jalkiy-kotenok-gif-2203365976465100550", | |
"https://tenor.com/view/cute-cat-gif-21549091", | |
"https://tenor.com/view/cat-funny-cathands-cat-in-hat-cat-with-hands-silly-cat-gif-14981685377760273746", | |
"https://tenor.com/view/gatito-cat-kitty-cute-silly-cat-gif-3290956017813741423", | |
"https://tenor.com/view/cat-nyash-meow-gif-27316147", | |
"https://tenor.com/view/hello-hi-cute-kitten-cat-gif-19842512", | |
"https://tenor.com/view/hollyweencandy-cat-cat-drink-milk-cat-eating-cat-drinking-gif-16978701194275077898", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1366462947186180156/VID-20250427-WA0019_1.gif?ex=68222cca&is=6820db4a&hm=f205a3d6d3886f79fc9a9c69e8edd81d56c80991580fb79813af01b83682012a&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1369919692868681770/0508.gif?ex=682239e2&is=6820e862&hm=23c04c86658ffacb70da333da39ad2c568dd475b14dbb378852c46e31ce58d6b&", | |
"https://tenor.com/view/multi-cat-vibrate-gif-25933609", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1371158199742365817/lv_0_20250511111151.gif?ex=68221e15&is=6820cc95&hm=a5954d23ee7e31bf1b7f33ddd2ac313057c6e0190e91a72b44700cce259a5673&", | |
"https://tenor.com/view/iwo-laught-peru-dota-iwo-iwobeka-gif-5591894748012791965", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1370974927607431200/lv_0_20250510230329.gif?ex=68221c26&is=6820caa6&hm=f60b095a9d8c44fa5d221a8d6fa0c6b0c3d7c06dc8bcdc61cecd5c42c29b94fe&", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1332945966042451991/stable-4-2025-01-26T05_17_14Z_1.gif?ex=6822306b&is=6820deeb&hm=7efba976e773452352513768e2f13a3cc7702bbb74a1eb509a4b9aa9f642bb62&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1361937335222276096/VID-20250416-WA0000_1.gif?ex=682230bc&is=6820df3c&hm=210dfe54221fa7484cd9cc386d31e83da692857798ef95610592547f1efee294&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1361058140325679275/negada_1.gif?ex=682249ab&is=6820f82b&hm=0edd025c275b03501eb9298435049710172aceadd55c89e2340eb39443fe4aeb&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1354938969023971539/bandicam_2024-07-29_02-36-33-482_video-converter.com_1.gif?ex=6821c77f&is=682075ff&hm=a33faa9bcdda24a389f1dad104d971e2386cabab9d0b16967a40cdec3d6d1695&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1353939061852864593/20250324_224340.gif?ex=682218c3&is=6820c743&hm=f78e4d21bc4828f72f462826ee3bc4f8aaef537e31adc621c09a5bf3dab9e1bd&", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1354076226389676153/20250324_104230.gif?ex=6821efc1&is=68209e41&hm=bba9074573a5cd43471a6df78072437e63efee65cfeba9b0dcc3121b3ee2e0d8&", | |
"https://tenor.com/view/backyardigans-austin-worst-day-ever-this-is-sad-gif-4091837549093265171" | |
] | |
SANDRA_GIF_URLS = [ | |
"https://tenor.com/view/hollyweencandy-cat-cat-drink-milk-cat-eating-cat-drinking-gif-16978701194275077898", | |
"https://tenor.com/view/fat-cat-fatty-sleepy-sleepfat-gif-27064818", | |
"https://tenor.com/view/cats-cat-cute-run-kitten-gif-14804766", | |
"https://media.discordapp.net/attachments/978373982011150369/981008116990771270/9C48BE6C-EA86-49CF-90DB-C07F58AAE464.gif?ex=684a2f01&is=6848dd81&hm=ff1d93124517188fa7a1da51156fac6d5d03aff697f45f6ca91d1bd6221d8bfd&", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/WTL02R1L7YCGUEunFy/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/GeimqsH0TLDt4tScGw/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/2zUn8hAwJwG4abiS0p/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/joYf3Ba2phD15ch9Nt/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/kkEmNte4tRmZ0fgBhE/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExeGs1a21xOWVpMXhndDBvdjhoMmdxNnk3Z2R6dTJqbmlramVoMTJmayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/W4iMEEOHdUEKMaf81Y/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3dzlqdzUzenF5c2JnYWRxMGRkOXhucjB2d2N3aDZrbTY4ODc3ZDR2MCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/wr7oA0rSjnWuiLJOY5/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/Q3j31NmtjhK7M2v6vS/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/BaWxQ2db82ifjsMps5/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/Tvb18axltg8g1SUViM/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/jP4pPl5z1lccFcGvR0/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/fdieMFo080TRtrCDjq/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/O5qsYpByKO5GnwLSTv/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/6lagkJ6byPKessWAfe/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3OW5oODQzdjRmMThxbjg0amV5OG5xaGdnNGExZ29raDBxaHFlZTNpYSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/SIarypru0lT9hHeRLU/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3OW5oODQzdjRmMThxbjg0amV5OG5xaGdnNGExZ29raDBxaHFlZTNpYSZlcD12MV9naWZzX3NlYXJjaCZjdD1n/43hpETOyeALzlWlKAr/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3bTJ4cmhzdzYxMDZ1eGJpZ2ZzOTJ5cjVxYW9oYWFzcGUwajc5YW5rdyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/EFaabvtq5aRzVhF0vt/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3bTJ4cmhzdzYxMDZ1eGJpZ2ZzOTJ5cjVxYW9oYWFzcGUwajc5YW5rdyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/4805zfHsKebGEw4McK/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPWVjZjA1ZTQ3bTJ4cmhzdzYxMDZ1eGJpZ2ZzOTJ5cjVxYW9oYWFzcGUwajc5YW5rdyZlcD12MV9naWZzX3NlYXJjaCZjdD1n/sUvphazvrEZeiSMoFR/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcmx0cDVwczFlOXZ4ajBvemRmM2hwM3BjaWhqcWdhbzF1NDM4ZnFwaiZlcD12MV9naWZzX3NlYXJjaCZjdD1n/FEHsYiEMOKTNRBmPou/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjkzd2F5aDAyYngzd3NsYmE3aWMzejgxaDZxZTNkNDN0OTJlb2dpMyZlcD12MV9zdGlja2Vyc19zZWFyY2gmY3Q9cw/FX5aKofPgom36xXCSe/giphy.gif", | |
"https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjkzd2F5aDAyYngzd3NsYmE3aWMzejgxaDZxZTNkNDN0OTJlb2dpMyZlcD12MV9zdGlja2Vyc19zZWFyY2gmY3Q9cw/KxDOKexAD6oHDMDFur/giphy.gif", | |
"https://tenor.com/view/the-subspace-emissary-diddy-kong-rayquaza-super-smash-bros-brawl-smash-bros-brawl-gif-25132786", | |
"https://tenor.com/view/cat-cute-cat-cat-dance-cute-cat-dance-ai-cat-gif-15064057413633942575", | |
"https://tenor.com/view/big-eyes-cat-funny-surprised-gif-27160365", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1336026895757873292/Yo-me-dedico-a-escucharte-_1_-_online-video-cutter.com_-_1_.webp?ex=6849be02&is=68486c82&hm=a2caeb43c4dccc043c8c16ceaf0865ae53b351fb9846f22f6d8d0b660748b14a&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1377677593192566914/20250529_175834.gif?ex=684a507e&is=6848fefe&hm=96667ccd642f7678c4c15233e02f337835222ccbc47f9d4f362481a0491e2f5f&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1377861762744844460/bloggif_68392fb3f1c2b.gif?ex=6849aa83&is=68485903&hm=4e6e20b796d904ff609f3e4fcbd8a34decca3f43828d2d4507e3e9496a375b33&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1374944033293598740/OOOOH_gift.gif?ex=684a41ea&is=6848f06a&hm=8292ff1ff815996ae107338ee23fe7e9778fc15fff507af073ae4a9a1bd812cd&", | |
"https://tenor.com/view/cat-black-black-cat-zoomies-cat-zoomies-gif-14689681662136345500", | |
"https://tenor.com/view/hey-there-cute-hide-peeking-adorable-gif-17597425", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1346338305394085918/clip_01JNC6H00EB2A7NCAMPRXF8Y8Y_1.gif?ex=6849ae81&is=68485d01&hm=ad486b3a8df5d1ec6bb2d2acdaaa4332add76b738b6c415516844817d5aa2226&", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1337285302477258763/lv_0_20250206235151.gif?ex=6849b4bd&is=6848633d&hm=b76022b4328342e1f4f9f824e8aaa5dd35d1661b1c0b19cd5eab1bea3f0cd6aa&", | |
"https://cdn.discordapp.com/attachments/966544639014367245/1360489830223708260/meme.gif?ex=6849bfa4&is=68486e24&hm=622b4a583d4822892fbd5c68cafdace9f5160a806e507f0a5801e519406c9c4b&", | |
"https://tenor.com/view/sonic-exe-freaky-sonic-the-hedgehog-sonic-rizz-gif-650553353834507764", | |
"https://tenor.com/view/multi-cat-vibrate-gif-25933609", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1369919692868681770/0508.gif?ex=6849c6e2&is=68487562&hm=1a2b5fd0990d232ec7f7e555eb0718dba69b5ffbe75bef1f91183e11fa3ab0dd&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1371158199742365817/lv_0_20250511111151.gif?ex=6849ab15&is=68485995&hm=f5af5097500dcf934e52460ba6afe3b3070baba4d7b2fc75d6ced6374dd35d6d&", | |
"https://cdn.discordapp.com/attachments/1268371581550465038/1305138643945394207/1017572385311957015.gif?ex=684a1755&is=6848c5d5&hm=7201f32bf790204f45dfa2ca89d3505d8706a66dc46983795deebfead9194b2b&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1353939061852864593/20250324_224340.gif?ex=684a4e83&is=6848fd03&hm=d5a453b07e784c4dfb195e4bfd7abc918eabd6dd07112f5cdc8511e1f8582471&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1354363457235062875/VID-20250324-WA0016_4.gif?ex=6849df83&is=68488e03&hm=d670862a25a4f6ed72f7b8bee40002f9ede8b1a01f01dec32fd87b1c8999ac31&", | |
"https://tenor.com/view/bee-gif-2221550446572997929", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1354076226389676153/20250324_104230.gif?ex=684a2581&is=6848d401&hm=8e41f5f98c6b0cb5c4695ca05acfa4b63ce6ac8b16e1bf6db1ddded51326994b&", | |
"https://media.discordapp.net/attachments/1285748350070685747/1293629032050458655/Bota_tu_muuuu.gif?ex=6849bf6b&is=68486deb&hm=38cf5b104951c05457684363c06b8e8be2eeff58e338be37a943c0028e232d61&", | |
"https://cdn.discordapp.com/attachments/934933495875268625/1256886654275293284/krecha.gif?ex=6849e4aa&is=6848932a&hm=0fc5cd1a53c2e3702b0bd20712d5812a7bf246f67803fea5b578d825ce1c1d21&", | |
"https://media.discordapp.net/attachments/446070454818439168/1043569815626973234/RDT_20221119_1524475765329155723282790.gif?ex=6849b4a0&is=68486320&hm=bab63382d3d0fbed85d3b0d5831f31a3469bb04673d61393908bfd837a10eb1a&", | |
"https://tenor.com/view/dance-cat-kitten-gcldc-tail-wagging-gif-17070177", | |
"https://tenor.com/view/bugsy-hamster-bedtime-stories-big-eyes-gif-15428063", | |
"https://tenor.com/view/let-me-out-cage-angry-gif-24075632", | |
"https://tenor.com/view/cat-berg-cat-orange-cat-swimming-gif-25177582", | |
"https://tenor.com/view/kitten-jump-kitten-fail-kitten-jump-gif-20189864", | |
"Eres bajo, ya sabes quién eres. No importa cuando lo leas.", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1378509827638165544/sandra_bauilandddooo.gif?ex=684a0bd2&is=6848ba52&hm=b2fb0817ecc36081bdd65c2ef6179b16737d6ae8dab3b376a267cf9d25174fd4&" | |
] | |
SMASH_GIF_URLS = [ | |
"https://tenor.com/view/cute-impatient-dog-bulldog-happy-gif-25124319", | |
"https://media.discordapp.net/attachments/978373982011150369/981008116990771270/9C48BE6C-EA86-49CF-90DB-C07F58AAE464.gif?ex=67b7d881&is=67b68701&hm=5b3a233dafc4de52414bae4280cb644fda85e12430a30470d7b2b59c78605d5a&", | |
"https://media.discordapp.net/attachments/1304500459565744161/1306263414607450142/media-iv-text.gif?ex=67b7e3db&is=67b6925b&hm=88be547a870fa4dc2ced25b470c2324a87b7ed7d0bfe8158a426f289c7b7d312&", | |
"https://media.discordapp.net/attachments/1330367547249524788/1334973793940144138/image0.gif?ex=67b7873b&is=67b635bb&hm=7429b7df7a90562babde0111e9bbcbfee1974ebbee12c857e8bbc59a2623a0af&=", | |
"https://media.discordapp.net/attachments/1037060119881601195/1176932252559622204/voicemessage.gif?ex=67b76193&is=67b61013&hm=394a35f837da28653683cb229f2209deeed4a9d6aaba2441de88968a34103342&=", | |
"https://tenor.com/view/funny-gif-11026644638307910936", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1353939061852864593/20250324_224340.gif?ex=67e37983&is=67e22803&hm=20d678dc7c3d3dfb675a538700ae8043f585c0212566ce50f7d967c116588a9f&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1353089318700322826/VID-20250322-WA0001_1.gif?ex=67e3ade0&is=67e25c60&hm=6db08416ebbd303e40d874db7fcc4debaf941340525751fcf3a1ff3c6c9f10b3&", | |
"https://cdn.discordapp.com/attachments/1330367547249524788/1352282951618007060/20250320_085121.gif?ex=67e361e3&is=67e21063&hm=d279183a87b3d690b4d8080dd5dcaaf201db8d8156908c6f356bccc99ff94297&", | |
"https://cdn.discordapp.com/attachments/1211488388935450746/1353953113102618735/lv_0_20250324234520.gif?ex=67e38699&is=67e23519&hm=b23cbc4d19555fc94aa688dca75a3709e2b036232f75096203df1d920d038e73&", | |
"https://tenor.com/view/bee-gif-2221550446572997929", | |
"https://tenor.com/view/cats-cat-cute-run-kitten-gif-14804766", | |
"https://tenor.com/view/ok-i-pull-up-gif-27257886", | |
"https://tenor.com/view/fat-cat-fatty-sleepy-sleepfat-gif-27064818", | |
"https://tenor.com/view/angry-cat-gif-25783770", | |
"https://tenor.com/view/jalkiy-kotenok-gif-2203365976465100550", | |
"https://tenor.com/view/cute-cat-gif-21549091", | |
"https://tenor.com/view/cat-funny-cathands-cat-in-hat-cat-with-hands-silly-cat-gif-14981685377760273746", | |
"https://tenor.com/view/gatito-cat-kitty-cute-silly-cat-gif-3290956017813741423", | |
"https://tenor.com/view/cat-nyash-meow-gif-27316147", | |
"https://tenor.com/view/hello-hi-cute-kitten-cat-gif-19842512", | |
"https://tenor.com/view/hollyweencandy-cat-cat-drink-milk-cat-eating-cat-drinking-gif-16978701194275077898", | |
"No te metas con el chico malo.", | |
"Hora de hacer correr la sangre.", | |
"¡¿Por qué me molestas?!", | |
"Déjamelo a mí, te quitaré ese peso de encima.", | |
"¿Quieres comprar habanos?", | |
"La noche me confunde.", | |
"¡Saluda a mi amiguito!", | |
"¿Alguien ha pedido un médico?", | |
"Oigo los llamamientos.", | |
"¿En qué puedo ayudar?", | |
"¿Necesitas mi ayuda?", | |
"¿Que ansías ahora buen señor?", | |
"Ahora mismo.", | |
"Tío, eso sí que es una buena elección.", | |
"Lo hago ¡ahora!", | |
"¡Aaaah!", | |
"¡Yeaaah!", | |
"Abracadabra, pata de cabra.", | |
"¿Te encuentras bien?", | |
"Quizás tenga algo para ti.", | |
"¡Será pegajoso!", | |
"¡Es un libro de cocina, es un libro de cocina!", | |
"¡Con tanto bicho muerto podríamos llenar un trolebus!", | |
"¡Por la Horda!", | |
"Lok-regar ogull.", | |
"Vamos allá.", | |
"Los espíritus están inquietos.", | |
"Hmmm.", | |
"Sí.", | |
"Dabu.", | |
"Por honor.", | |
"Lok-narosh!", | |
"¡Nadie sobrevivirá!", | |
"¡Por Doomhammer!", | |
"¡Ha llegado tu hora!", | |
"¡Pero no soy estúpido!", | |
"Mi pueblo es fuerte.", | |
"Lo conduciré a su destino.", | |
"Los espíritus me guiarán.", | |
"Es verdad que he crecido con los humanos.", "Listo para la acción.", | |
"¿Sí?", | |
"¿Hmmm?", | |
"¿Qué quieres?", | |
"¿Tengo que hacer algo?", | |
"Puedo hacerlo.", | |
"Estaré encantado.", | |
"Trabajo trabajo.", | |
"Okey McKey.", | |
"¡Okey McKey!", | |
"¡A por ellos!", | |
"Vale...", | |
"¿Por qué no?", | |
"¿Quéee?", | |
"Yo ocupado. ¡Dejadme en paz!", | |
"No tiempo para jueguecitos.", | |
"¡Yo no ser ese tipo de orco!", | |
"¡Mi vida por la Horda!", | |
"¿Eh?", | |
"¿Jefe?", | |
"¡Dabu!", | |
"¡Lok'tar!", | |
"¡Swobu!", | |
"¡Zug zug!", | |
"¡Tiempo de matar!", | |
"¡Rrrr!", | |
"¡Tiempo de morir!", | |
"¡Por la Horda!", | |
"¿Qué demonios quieres esta vez?", | |
"¿Por qué no te buscas un ejército y dejas de tocarme las narices?", | |
"Fisgar, fisgar y fisgar, ¿eso es lo único que sabes hacer?", | |
"Ooh, eso sí que ha sido bonito...", | |
"Yo tener cuernos, yo herir a ti hace tiempo.", | |
"Yo no como Yoda hablar. ¿O hacerlo?", | |
"(cantando) ¡Ser verde no es nada fácil!", | |
"Listos para cabalgar.", | |
"¿Sí jefe?", | |
"Mmm", | |
"¿Necesitas algo?", | |
"Di la palabra.", | |
"No problem.", | |
"¡Yujuu!", | |
"¡Vamos!", | |
"En marcha.", | |
"¡Acaba con ellos!", | |
"¡Prueba mi acero!", | |
"¡Por Doomhammer!", | |
"¡Por la gloria del Jefe!", | |
"Piltrafilla.", | |
"Estás molestando a mi perro.", | |
"¿A qué huele? Oh, ¡perro malo!", | |
"Tengo más hambre que el lobo de Caperucita Roja.", | |
"Que los ancestros me protejan.", | |
"Provócalo.", | |
"Puedo ayudar.", | |
"¿Cómo? ¿Ahora?", | |
"Por las tribus", | |
"Inmediatamente.", | |
"Bien hecho.", | |
"¡Muerte a los enemigos de la Horda!", | |
"¡Muerte al enemigo!", | |
"¡Empezad a correr!", | |
"(Bramidos)", | |
"No me empujes que te doy un meneo de cuernos.", | |
"Eh toro, eh.", | |
"¿Tienes leche?", | |
"¡Cuate, aquí hay tomate!", | |
"Eh, ¿qué son esas letras grabadas en mi trasero?", | |
"Olé.", | |
"(se rompen muchas cosas) Lo siento.", | |
"Venganza por Zul'jin.", | |
"¿Quién tú querer matar yo?", | |
"¿Qué?", | |
"¿Qué querer tú hacer yo?", | |
"¿Dónde tú querer ir yo?", | |
"Aah.", | |
"Lo que desees.", | |
"Lo tienes, chico.", | |
"Sí... (risa)", | |
"¡Taz'dingo!" | |
] | |
# Definición de la clase de configuración para cada canal | |
class DiscordChannel: | |
name: str | |
url: str | |
min_interval: int # ✅ Mover estos antes de los que tienen valores por defecto | |
max_interval: int | |
sticker_ids: list = field(default_factory=list) | |
gif_urls: list = field(default_factory=list) | |
texts: list = field(default_factory=list) | |
# Configuración de los canales | |
channels = [ | |
DiscordChannel( | |
name="sandra", | |
url="https://discord.com/api/v9/channels/1330367547249524788/messages", | |
min_interval=500, | |
max_interval=700, | |
sticker_ids=SANDRA_STICKER_IDS, | |
gif_urls=SANDRA_GIF_URLS | |
) | |
] | |
""", | |
DiscordChannel( | |
name="smash", | |
url="https://discord.com/api/v9/channels/1211488388935450746/messages", | |
#url="https://discord.com/api/v9/channels/1327670116401287229/messages", | |
min_interval=165, | |
max_interval=180, | |
sticker_ids=SMASH_STICKERS_IDS, | |
gif_urls=SMASH_GIF_URLS | |
) | |
""" | |
def send_message(data: dict, channel: DiscordChannel): | |
""" | |
Envía un mensaje al canal de Discord indicado, gestionando errores y reintentos. | |
""" | |
while True: | |
try: | |
response = requests.post(channel.url, headers=HEADERS, json=data) | |
if response.status_code == 429: | |
retry_after = response.json().get("retry_after", 5) | |
logger.warning(f"[{channel.name}] Límite alcanzado. Reintentando en {retry_after}s...") | |
time.sleep(retry_after) | |
continue | |
if response.ok: | |
logger.info(f"[{channel.name}] Mensaje enviado correctamente: {data}") | |
else: | |
logger.error(f"[{channel.name}] Error {response.status_code}: {response.text}") | |
response.raise_for_status() | |
break | |
except requests.exceptions.RequestException as e: | |
logger.error(f"[{channel.name}] Error de conexión: {e}") | |
time.sleep(5) | |
def send_random_channel(channel: DiscordChannel): | |
""" | |
Envía aleatoriamente un sticker o un GIF al canal especificado, esperando un intervalo aleatorio entre envíos. | |
""" | |
while True: | |
# Se elige aleatoriamente entre enviar sticker o GIF | |
action_type = random.choice(["sticker", "gif"]) | |
if action_type == "sticker" and channel.sticker_ids: | |
data = {"sticker_ids": [random.choice(channel.sticker_ids)]} | |
elif action_type == "gif" and channel.gif_urls: | |
data = {"content": random.choice(channel.gif_urls)} | |
else: | |
# Si por alguna razón no hay stickers o GIFs disponibles, se envía un mensaje de texto simple | |
data = {"content": random.choice(channel.texts)} | |
send_message(data, channel) | |
sleep_time = random.randint(channel.min_interval, channel.max_interval) | |
logger.info(f"[{channel.name}] Esperando {sleep_time} segundos antes del próximo envío.") | |
time.sleep(sleep_time) | |
app = FastAPI() | |
def read_root(): | |
return {"status": "ok"} | |
def ping(): | |
return {"message": "pong"} | |
def start_background_tasks(): | |
""" | |
Al arrancar FastAPI, se inicia un hilo en segundo plano para cada canal. | |
""" | |
for channel in channels: | |
thread = threading.Thread(target=send_random_channel, args=(channel,), daemon=True) | |
thread.start() | |
logger.info(f"Iniciado hilo de fondo para el canal: {channel.name}") | |