mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Create admin_filter_example.py
This commit is contained in:
parent
9c86ed623d
commit
cd92d95f91
12
examples/custom_filters/admin_filter_example.py
Normal file
12
examples/custom_filters/admin_filter_example.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import telebot
|
||||||
|
from telebot import custom_filters
|
||||||
|
bot = telebot.TeleBot('TOKEN')
|
||||||
|
|
||||||
|
# Handler
|
||||||
|
@bot.message_handler(chat_types=['supergroup'], is_chat_admin=True)
|
||||||
|
def answer_for_admin(message):
|
||||||
|
bot.send_message(message.chat.id,"hello my admin")
|
||||||
|
|
||||||
|
# Register filter
|
||||||
|
bot.add_custom_filter(custom_filters.IsAdminFilter(bot))
|
||||||
|
bot.polling()
|
Loading…
Reference in New Issue
Block a user