コード例 #1
0
    'sticker':
    Filters.sticker,
    'audio':
    Filters.audio,
    'voice':
    Filters.voice,
    'document':
    Filters.document,
    'video':
    Filters.video,
    'contact':
    Filters.contact,
    'photo':
    Filters.photo,
    'gif':
    Filters.document & CustomFilters.mime_type("video/mp4"),
    '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")
OTHER = Filters.game | Filters.sticker | GIF
コード例 #2
0
ファイル: locks.py プロジェクト: teamanomaly/saraak_bot
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
    & CustomFilters.mime_type("application/vnd.android.package-archive"),
    'video':
    Filters.video,
    'contact':
    Filters.contact,
    'photo':
    Filters.photo,
    'gif':
    Filters.document & CustomFilters.mime_type("video/mp4"),
    'url':
    Filters.entity(MessageEntity.URL)
    | Filters.caption_entity(MessageEntity.URL),
    'bots':
    Filters.status_update.new_chat_members,
    'forward':
    Filters.forwarded,
コード例 #3
0
ファイル: locks.py プロジェクト: soulr344/tgbot
from telegram.ext.dispatcher import run_async
from telegram.utils.helpers import mention_html

import tg_bot.modules.sql.locks_sql as sql
from tg_bot import dispatcher, SUDO_USERS, LOGGER
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, is_user_in_chat
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 & ~Filters.animation & CustomFilters.mime_type("application/vnd.android.package-archive"),
              'video': Filters.video,
              'videonote': Filters.video_note,
              'contact': Filters.contact,
              'photo': Filters.photo,
              '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,
              'emoji': CustomFilters.has_emoji,
              'bigemoji': CustomFilters.is_emoji,
              }
              
コード例 #4
0
ファイル: locks.py プロジェクト: FiestaLake/tgbot
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
from tg_bot.modules.helper_funcs.perms import check_perms

LOCK_TYPES = {
    "sticker":
    Filters.sticker,
    "audio":
    Filters.audio,
    "voice":
    Filters.voice,
    "document":
    Filters.document
    & ~Filters.animation
    & CustomFilters.mime_type("application/vnd.android.package-archive"),
    "video":
    Filters.video,
    "videonote":
    Filters.video_note,
    "contact":
    Filters.contact,
    "photo":
    Filters.photo,
    "gif":
    Filters.animation,
    "url":
    Filters.entity(MessageEntity.URL)
    | Filters.caption_entity(MessageEntity.URL),
    "bots":
    Filters.status_update.new_chat_members,