天道酬勤,学无止境

skype4py

如何在 Python 中使用 Skype4Py 向群组对话发送消息(How can I send a message to a group conversation with Skype4Py in Python)

问题 我一直在尝试让我的脚本使用 Skype4Py 库向 Skype 中的群组对话发送消息,我目前能够向特定用户发送消息的唯一方法。 import Skype4Py Skype = Skype4Py.Skype() Skype.Attach() Skype.SendMessage('namehere','testmessage') 有谁知道如何更改我的代码以向群组对话发送消息? 回答1 下面的小脚本应该可以工作。 (假设您已经打开了群聊) def sendGroupChatMessage(): """ Send Group Chat Messages. """ import Skype4Py as skype skypeClient = skype.Skype() skypeClient.Attach() for elem in skypeClient.ActiveChats: if len(elem.Members) > 2: elem.SendMessage("SomeMessageHere") 我基本上是导入所有当前的聊天记录,检查成员数量并相应地发送消息。 在不同的组内检查也应该很容易。 要获得句柄,请将您的功能更改为此。 def sendGroupChatMessage(): """ Send Group Chat Messages. """ import

2021-06-10 09:12:37    分类:技术分享    python   python-2.7   sendmessage   skype4py

How can I send a message to a group conversation with Skype4Py in Python

I've been trying to get my script to send a message to a group conversation in Skype using the Skype4Py library, the only way I am currently able to send messages is to specific users. import Skype4Py Skype = Skype4Py.Skype() Skype.Attach() Skype.SendMessage('namehere','testmessage') Does anyone know how I can change my code to send a message to a group conversation?

2021-05-17 11:06:16    分类:问答    python   python-2.7   sendmessage   skype4py