Answer the question
In order to leave comments, you need to log in
Why is checking for administrator not working properly?
There is the following piece of code that acts as a check for an administrator in a conversation:
ConvItms = vk.method("messages.getConversationMembers",{"peer_id": 2000000000 + id, "group_id": 'мой айди'})["items"]
for Member in ConvItms:
if Member["is_admin"]:
try:
vk.method("messages.removeChatUser", {'chat_id': id, 'user_id': renmes.split(' ')[1]})
kicked = renmes.split(' ')[1]
chatsender(id, 'Глава Клана Амир Ринамов исключил' + ' ' + '@id' + kicked + '\n'
'❓По причине: Нарушение 2.1-2.5 пунктов правил❓')
except:
forwardsender(id, '❌Rinami-sama, участник отсутствует в беседе❌')
else:
chatsender(id, '❌Ты не Rinami-sama❌')
break
Answer the question
In order to leave comments, you need to log in
Member["is_admin"] here can be just the String True or False, and not a Boolean value,
you need to do print(type(Member["is_admin"])) and after analyzing this, write the condition correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question