因此,我正在为自己的团队制作自己的Skype机器人,但我不知道如何检索自己生命中的最新消息。我经常处理一些小问题,因此我迅速查阅了Internet和stackoverflow,但是Skype4Py文档中几乎没有关于特定功能的文档,而stackoverflow上则一无所有。这是我的代码,请帮忙?

#Importing!
import time, sys
import Skype4Py

#Set skypeclient and connect, while also setting my desired user
skypeClient = Skype4Py.Skype()
skypeClient.Attach()
user = sys.argv[1]

#Loop!
while 1:
    """
    Here I am stumped. I have tried skypeClient.Chat.GetRecentMessages(),
    skypeClient.Chat.Chat.GetRecentMessages
    and that wouldn't even work for my purposes if it did work!
    """

最佳答案

使用

def Commands(Message, Status):
    if Status == 'SENT' or (Status == 'RECEIVED'):
        running = 1
        message = Message.Body.lower()
        handle = Message.FromHandle.upper()
        if running == 1:
            if message == 'WHATEVER':


然后,

skype = Skype4Py.Skype()
skype.OnMessageStatus = Commands
skype.Attach()
while True:
    pass


为我工作!

关于python - Skype4Py收到消息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27305402/

10-13 09:06