support send message to all contact
This commit is contained in:
@@ -436,6 +436,17 @@ class WebWeixin(object):
|
|||||||
else:
|
else:
|
||||||
print '[*] 此用户不存在'
|
print '[*] 此用户不存在'
|
||||||
|
|
||||||
|
def sendMsgToAll(self, word):
|
||||||
|
for contact in self.ContactList:
|
||||||
|
name = contact['RemarkName'] if contact['RemarkName'] else contact['NickName']
|
||||||
|
id = contact['UserName']
|
||||||
|
self._echo('-> '+name+': '+word)
|
||||||
|
if self.webwxsendmsg(word, id):
|
||||||
|
print ' [成功]'
|
||||||
|
else:
|
||||||
|
print ' [失败]'
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
@catchKeyboardInterrupt
|
@catchKeyboardInterrupt
|
||||||
def start(self):
|
def start(self):
|
||||||
print '[*] 微信网页版 ... 开动'
|
print '[*] 微信网页版 ... 开动'
|
||||||
@@ -466,7 +477,8 @@ class WebWeixin(object):
|
|||||||
exit('[*] 退出微信')
|
exit('[*] 退出微信')
|
||||||
elif text[:2] == '->':
|
elif text[:2] == '->':
|
||||||
[name, word] = text[2:].split(':')
|
[name, word] = text[2:].split(':')
|
||||||
self.sendMsg(name, word)
|
if name == 'all': self.sendMsgToAll(word)
|
||||||
|
else: self.sendMsg(name, word)
|
||||||
elif text[:3] == 'm->':
|
elif text[:3] == 'm->':
|
||||||
[name, file] = text[3:].split(':')
|
[name, file] = text[3:].split(':')
|
||||||
self.sendMsg(name, file, True)
|
self.sendMsg(name, file, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user