Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Skype4py receiving chat messages

Hello! I have some code that's supposed to run when Skype receives new messages, the code looks like this:

PHP Code

<?php 
import Skype4Py

def RecievedMessage
(msg, status):
    if 
status == Skype4Py.cmsReceived:
        print 
"I got your message!"


skype = Skype4Py.Skype()
skype.OnMessageStatus = RecievedMessage
skype
.Attach()
while 
True:   #This just keeps the script alive
    
pass 

I am aware Skype has cut skype4com which is what skype4py uses, hence why you can no longer send messages with it (even though there's a workaround)

I've tried tons of different ways of doing this, all of which fail to work without errors even occurring. Is there something wrong with my code? Or could this also no longer be supported?
[Image: 5BgQiIm.gif]

Try changing it to:

Code
def RecievedMessage(msg, status):
       print "I got your message!"

Does that work at all?
(Mar 2, 2017 04:28 PM)(╯°□°)╯︵ ┻━━┻ Wrote:  Try changing it to:

Code
def RecievedMessage(msg, status):
       print "I got your message!"

Does that work at all?

The console just stays empty. It doesn't seem like skype.OnMessageStatus is functional, that or something else is going wrong?
[Image: 5BgQiIm.gif]

(Mar 2, 2017 04:35 PM)TheWarOwl Wrote:  The console just stays empty. It doesn't seem like skype.OnMessageStatus is functional, that or something else is going wrong?

Did you accept the skype connection request in skype itself first?
(Mar 2, 2017 05:09 PM)(╯°□°)╯︵ ┻━━┻ Wrote:  Did you accept the skype connection request in skype itself first?

Of course, I'm pretty familiar with using the module actually, I can't find anything on it online or in the documentation
[Image: 5BgQiIm.gif]

OP, correct me if I'm wrong, but didn't Skype totally remove their API?
(Mar 2, 2017 06:47 PM)obby Wrote:  OP, correct me if I'm wrong, but didn't Skype totally remove their API?

They did, but a lot of the features still work. I mentioned that in my post


Yo guys, I logged into my main account and the script is working ._. thanks for the help!

I've just looked into what was going on, It was because I was using an alt account through the web based skype making it so skype4com couldn't work with it, receiving messages from friends worked because they're using the actual skype client
[Image: 5BgQiIm.gif]



Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by HardStoNFeb 18, 2021 05:33 AM 0 166 Feb 18, 2021 05:33 AM
Last Post: HardStoN
[C] by HardStoNNov 10, 2020 02:19 PM 2 127 Nov 10, 2020 02:19 PM
Last Post: HardStoN
[Java] by +ErvinasJul 29, 2017 02:16 PM 7 282 Jul 29, 2017 02:16 PM
Last Post: matt