我开始编写Skype bot作为我的第一个Python项目。它实际发送消息时效果很好,但有时它完全没有发送消息。我不确定是因为我写得不好还是因为我的互联网连接。
botfuncs
通常无法在my code中发送消息:
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