I have a skypebot with commands. One of the commands I'm trying to implement is "promote_to_master":
# chat is Skype4Py.chat.Chat object, user_string is str
def promote_to_master(self, chat, user_string):
if self.is_creator_or_master(chat):
for member in chat.Members:
if member.Handle == user_string:
logging.info("Member promoted")
member.Role = Skype4Py.chatMemberRoleMaster
return "Member promoted"
The bot is a MASTER, the target a USER. No errors are thrown, but the member's role is not changed in the chat. I do see the log entry. print type(member)
shows <class 'Skype4Py.user.User'>
, which it seems can't have a Role changed, but I'm not sure.
In the group chat, a commander uses: !promote user
After running, using /whois user
gives:
member: user
role: USER
subscribed: YES
banned: NO
online locations: [scrubbed]
Any thoughts?