bot can no longer send unavailable stickers with the tag

This commit is contained in:
david committed 2026-10-14 22:39:55 -03:00
1 parent 8f287c89e5
commit 090fb736e5
1 file changed
+4 -4
+4 -4
View File
@@ -436,8 +436,8 @@ def reaction_tool_prompt(guild) -> str:
sync_reactions(guild)
data = load_reactions()
have = {
"stickers": {s.name for s in guild.stickers},
"emojis": {e.name for e in guild.emojis},
"stickers": {s.name for s in guild.stickers if s.available}, # unavailable = locked after the boost level dropped
"emojis": {e.name for e in guild.emojis if e.available},
"media": {n for n in saved_media if (MEDIA_DIR / n).is_file()},
}
sections = []
@@ -461,13 +461,13 @@ async def send_reaction(message, kind: str, name: str):
name = name.strip().strip(":").lower()
try:
if kind == "sticker":
chosen = next((s for s in message.guild.stickers if s.name.lower() == name), None)
chosen = next((s for s in message.guild.stickers if s.available and s.name.lower() == name), None)
if chosen:
await message.channel.send(stickers=[chosen])
log_message(f"[{now_str()}] Faggot-chan sent sticker: {chosen.name}")
print(f"[{now_str()}] Faggot-chan sent sticker: {chosen.name}")
elif kind == "emoji":
chosen = next((e for e in message.guild.emojis if e.name.lower() == name), None)
chosen = next((e for e in message.guild.emojis if e.available and e.name.lower() == name), None)
if chosen:
await message.add_reaction(chosen)
elif kind == "media":