Skip to content

Commit

Permalink
Merge pull request Urinx#3 from Haskely/Python-3
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
Haskely authored Feb 21, 2017
2 parents 02a1c53 + 28bb790 commit 0834dfa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions weixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,24 +641,24 @@ def getUserRemarkName(self, id):
for member in self.SpecialUsersList:
if member['UserName'] == id:
name = member['RemarkName'] if member[
b'RemarkName'] else member['NickName']
'RemarkName'] else member['NickName']

# 公众号或服务号
for member in self.PublicUsersList:
if member['UserName'] == id:
name = member['RemarkName'] if member[
b'RemarkName'] else member['NickName']
'RemarkName'] else member['NickName']

# 直接联系人
for member in self.ContactList:
if member['UserName'] == id:
name = member['RemarkName'] if member[
b'RemarkName'] else member['NickName']
'RemarkName'] else member['NickName']
# 群友
for member in self.GroupMemeberList:
if member['UserName'] == id:
name = member['DisplayName'] if member[
b'DisplayName'] else member['NickName']
'DisplayName'] else member['NickName']

if name == '未知群' or name == '陌生人':
logging.debug(id)
Expand Down Expand Up @@ -910,7 +910,7 @@ def sendMsg(self, name, word, isfile=False):
def sendMsgToAll(self, word):
for contact in self.ContactList:
name = contact['RemarkName'] if contact[
b'RemarkName'] else contact['NickName']
'RemarkName'] else contact['NickName']
id = contact['UserName']
self._echo('-> ' + name + ': ' + word)
if self.webwxsendmsg(word, id):
Expand Down

0 comments on commit 0834dfa

Please sign in to comment.