我已经开始编写一个 Skype 机器人作为我的第一个 Python 项目。它在实际发送消息时工作得很好,但有时它完全不发送消息。我不确定是因为我写得不好还是因为我的互联网连接。
botfuncs
是通常无法在我的代码中发送消息的那个:
def botfuncs():
def OnMessageStatus(Message, Status):
if Status == 'RECEIVED':
c = Message.Body
if Message.Body.lower() == "time":
client.SendMessage(Message.FromHandle, "The current time is {0}".format(time.strftime("%Y, %b %d, %H:%M:%S.")))
elif c[0:4].lower() == "sudo":
client.SendMessage(Message.FromHandle, c[5:])
client.OnMessageStatus = OnMessageStatus