MCPcopy
hub / github.com/liuwons/wxBot / send_msg

Method send_msg

wxbot.py:500–523  ·  view source on GitHub ↗
(self, name, word, isfile=False)

Source from the content-addressed store, hash-verified

498 return ''
499
500 def send_msg(self, name, word, isfile=False):
501 uid = self.get_user_id(name)
502 if uid:
503 if isfile:
504 with open(word, 'r') as f:
505 result = True
506 for line in f.readlines():
507 line = line.replace('\n', '')
508 print '-> ' + name + ': ' + line
509 if self.send_msg_by_uid(line, uid):
510 pass
511 else:
512 result = False
513 time.sleep(1)
514 return result
515 else:
516 if self.send_msg_by_uid(word, uid):
517 return True
518 else:
519 return False
520 else:
521 if self.DEBUG:
522 print '[ERROR] This user does not exist .'
523 return True
524
525 @staticmethod
526 def search_content(key, content, fmat='attr'):

Callers

nothing calls this directly

Calls 2

get_user_idMethod · 0.95
send_msg_by_uidMethod · 0.95

Tested by

no test coverage detected