Skip to content

Commit

Permalink
feat: bump custom emoji limit to 250 and stickers limit to 50
Browse files Browse the repository at this point in the history
  • Loading branch information
tnix100 committed Aug 14, 2024
1 parent 98d8a78 commit f72906d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rest_api/v0/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,12 @@ async def create_chat_emote(chat_id: str, emote_type: Literal["emojis", "sticker
if chat["type"] != 1 and chat["owner"] != request.user:
abort(403)

# Make sure there's not too many emotes in the chat (100 for emojis, 25 for stickers)
# Make sure there's not too many emotes in the chat (250 for emojis, 50 for stickers)
if emote_type == "emojis":
if db.chat_emojis.count_documents({"chat_id": chat_id}, limit=100) >= 100:
if db.chat_emojis.count_documents({"chat_id": chat_id}, limit=250) >= 250:
return {"error": True, "type": "tooManyEmojis"}, 403
elif emote_type == "stickers":
if db.chat_stickers.count_documents({"chat_id": chat_id}, limit=25) >= 25:
if db.chat_stickers.count_documents({"chat_id": chat_id}, limit=50) >= 50:
return {"error": True, "type": "tooManyStickers"}, 403

# Claim file
Expand Down

0 comments on commit f72906d

Please sign in to comment.