Reputation: 1
Basically, I'm trying to create a skype bot with Skype4Py. My current code work fine in legacy (p2p) group chats and in normal message, but not in the new group chats. Here's my code:
import Skype4Py
prefix = "My Bot: "
def command(Message, Status):
if Status == 'SENT' or Status == 'RECEIVED':
msg = Message.Body.lower()
if (msg == ",help"):
send(Message, "Hello!")
def send(Message, String):
final = prefix+String
Message.Chat.SendMessage(final)
skype = Skype4Py.Skype();
skype.OnMessageStatus = command
if skype.Client.IsRunning == False:
skype.Client.Start()
skype.Attach();
while True:
input('')
Upvotes: 0
Views: 1741
Reputation: 51
If your new group chat is "cloud-based chats", Skype4py do not work well.
For example, create a new group chat, then run code follows:
import Skype4Py
skype = Skype4Py.Skype()
skype.Attach()
for chat in skype.Chats :
print chat.Name
Legacy (p2p) group chats is listed, but new (cloud-based) group chat is not listed.
If you want to make your code work well, you have to create a legacy (p2p) group chats.
Please try this:
Skype FAQ - What are chat commands and roles?
To find out what type of chat you're in, simply type /get name into the chat window and press Enter. If the group name response starts with "19:...", you're in a cloud-based chat; if the group name response starts with "#skypename...", you're in a P2P-based chat.
-- snip --
All new groups created will be cloud-based groups. If you want to create a P2P-based group (to make use of the legacy moderator functionality), type /createmoderatedchat. This will create a new chat group called Empty Group, to which you can add users and use the full list of P2P-based chat commands described below.
Upvotes: 3