restrict_chat_memeber and chat type

20 Views Asked by At

-------- QUSTION 1

I tried so many times to mute user for a time in a group.

can_send_message = False
await bot.restrict_chat_member(message.chat.id, user_id, permissions=can_send_message)

As you see there is a problem, it is not working, I read the documentation, but I still didn't understand how to do it


------- QUESTION 2

# @bot.message_handler(commands=['balance'], func=lambda message: message.chat.type in ['private', 'group', 'supergroup'])
@router.message(Command('balance'))

As you can see, the there is a 2 lines of code, in the first line you see a code on "telebot" library, and on the second you see "aiogram" code. So, I don't know how to do the same, get messages only in ['private', 'group', 'supergroup']

0

There are 0 best solutions below