opensourcehacker / sevabot

A Skype bot supporting integration with external services
http://sevabot-skype-bot.readthedocs.org/
565 stars 121 forks source link

Is their any way to access the User Name of the skypeUser who send a chat to SkypeBot. #90

Open mayankraipure opened 9 years ago

mayankraipure commented 9 years ago

I want to access the UserName who set a chat to other user .

I have tried with currentUser but It return the user name of skypebot.

SebastienGllmt commented 9 years ago

I believe that information is attached to the message. Have you tried msg.Sender

mayankraipure commented 9 years ago

I found the Sender in ChatMessage Class, and I tried accessing it skype4py.Skype() but Not able to access this Class. Is their any other way to access this Class .

mayankraipure commented 9 years ago

skype =skype4py.Skype() msg =skype.Message() //Getting Problem here From where I can get the Id. msg.Sender.FullName

File "/home/skype/sevabot/modules/prog.py", line 33, in print 'Sender Name:' , skype.Message().Sender.FullName File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 665, in Message o.Status # Test if such an id is known. File "/usr/local/lib/python2.7/dist-packages/Skype4Py/chat.py", line 573, in _GetStatus return str(self._Property('STATUS')) File "/usr/local/lib/python2.7/dist-packages/Skype4Py/chat.py", line 427, in _Property return self._Owner._Property('CHATMESSAGE', self.Id, PropName, Value, Cache) File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 296, in _Property value = self._DoCommand('GET %s' % jarg, jarg) File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 281, in _DoCommand raise SkypeError(int(errnum), errstr) Skype4Py.errors.SkypeError: [Errno 15] Unknown message