Terrance / SkPy

An unofficial Python library for interacting with the Skype HTTP API.
https://skpy.t.allofti.me
BSD 3-Clause "New" or "Revised" License
268 stars 66 forks source link

{"errorCode":804,"message":"Quarantine limit Exceeded"} when sending message to some contacts #231

Closed qwertyNodes closed 1 year ago

qwertyNodes commented 1 year ago

This is strange, because not for all contacts I get such an error. Does anybody know what it means?

Terrance commented 1 year ago

Without context, I'm to assume you're sending a sufficient number of messages to trigger Skype for Web rate limits. As a reminder, this library is a wrapper around the Skype web client, which does not expect (and will likely defend against) automated usage.

qwertyNodes commented 1 year ago

I have figured out what the problem is. This error causes when the contact has not accepted the conversation. For unaccepted conversations, you can send max 5 messages after which you will receive this error. So in order not to risk your account, you need to check whether the contact is authorized before sending the message:

client.contacts[contact_username].authorised: bool

Maybe it will help someone.

Thank you Terrance for your work.

qwertyNodes commented 1 year ago

Better to check this way because "authorized" property can absent for some users


    # conversation accepted
    user.chat.raw['properties']['conversationstatus'] = 'Accepted'

    # conversation pending with messages
    user.chat.raw['properties']['conversationstatus'] = 'AcceptPendingSender'

    # no conversations at the moment
    user.chat.raw = None