Skip to content

Commit

Permalink
Use filters.animation for gifs + dont include gifs as documents
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSonOfLars authored and MD Raza committed Jul 14, 2020
1 parent 83e8a13 commit ec6e53c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ future
emoji
requests
sqlalchemy
python-telegram-bot>=10.1.0
python-telegram-bot>=11.1.0
psycopg2-binary
feedparser
7 changes: 3 additions & 4 deletions tg_bot/modules/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@
from tg_bot.modules.disable import DisableAbleCommandHandler
from tg_bot.modules.helper_funcs.chat_status import can_delete, is_user_admin, user_not_admin, user_admin, \
bot_can_delete, is_bot_admin
from tg_bot.modules.helper_funcs.filters import CustomFilters
from tg_bot.modules.log_channel import loggable
from tg_bot.modules.sql import users_sql

LOCK_TYPES = {'sticker': Filters.sticker,
'audio': Filters.audio,
'voice': Filters.voice,
'document': Filters.document,
'document': Filters.document & ~Filters.animation,
'video': Filters.video,
'contact': Filters.contact,
'photo': Filters.photo,
'gif': Filters.document & CustomFilters.mime_type("video/mp4"),
'gif': Filters.animation,
'url': Filters.entity(MessageEntity.URL) | Filters.caption_entity(MessageEntity.URL),
'bots': Filters.status_update.new_chat_members,
'forward': Filters.forwarded,
'game': Filters.game,
'location': Filters.location,
}

GIF = Filters.document & CustomFilters.mime_type("video/mp4")
GIF = Filters.animation
OTHER = Filters.game | Filters.sticker | GIF
MEDIA = Filters.audio | Filters.document | Filters.video | Filters.voice | Filters.photo
MESSAGES = Filters.text | Filters.contact | Filters.location | Filters.venue | Filters.command | MEDIA | OTHER
Expand Down

0 comments on commit ec6e53c

Please sign in to comment.