Exemplo n.º 1
0
def QTerm():
    port = getPort()
    req = 'help'
    while req != 'quit':
        if req:
            resp = query(port, req)
            if not resp:
                RAWINPUT('与 QQBot term 服务器的连接已断开,按回车键退出')
                break
            if resp == 'QQBot已停止':
                RAWINPUT('QQBot已停止,按回车键退出')
                break
            resp = resp.strip()
            while True:
                front, resp = Utf8Partition(resp, 800)
                if resp:
                    RAWINPUT(front)
                else:
                    resp = front
                    break
        else:
            resp = ''

        if resp:
            req = RAWINPUT(resp + '\nqterm>> ').strip()
        else:
            req = RAWINPUT('qterm>> ').strip()
Exemplo n.º 2
0
 def SendTo(self, contact, content):
     if content:
         content = str(content)
         result = '向 %s 发消息成功' % str(contact)
         while content:
             front, content = Utf8Partition(content, 600)
             self.send(contact.ctype, contact.uin, front)
             INFO('%s:%s' % (result, front))
         return result
Exemplo n.º 3
0
 def send(self, msgType, to_uin, msg):
     while msg:
         front, msg = Utf8Partition(msg, 600)
         self._send(msgType, to_uin, front)