mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.03k stars 796 forks source link

Implement new feature for joining groups via link #1084

Open mouhammad-zd opened 3 years ago

mouhammad-zd commented 3 years ago
  • Advertising of monetized Frameworks is strictly forbidden and will be reported

  • [x] The language must be English, if you are not fluent in English consider using: https://www.deepl.com/translator if it supports your native language

  • [ ] Please check if any other issue already adresses your concerns or if a recent PR is already fixing the mentioned issue

  • [x] Please make sure to format your code, and to mark your code as such, with the provided tools from github (upper right of this box)

  • [ ] Please state your Operating System (inlcuding version), your Python Version, and your installation way (pip, from repo) and if you are running it inside a docker container

  • [ ] Note that the pip installation might be behind, so try to fix your issue with a pull from the repo and update to the most recent version

  • [ ] Follow the Stackoverflow Guidelines (https://stackoverflow.com/help/how-to-ask) when in need of help

  • [ ] Consider posting your question on Stackoverflow if it is a general programming question

  • [x] There will be no support for spamming, or other mischief

  • [ ] There will be no support for finding professionals

Hello,

I have 2 questions

1- i ought to implement a new feature for joining groups via link

I write this code , taken from https://github.com/open-wa/wa-automate-nodejs/blob/e2e38ced276ad1a3f4a2991e9349c2cad9fcc42b/src/lib/wapi.js#L1413

    {
        return await window.Store.WapQuery.acceptGroupInvite(link.split('\/').pop())
                .then(res=>
                    {
                        return res.status===200?res.gid._serialized:res.status;
                    });
    }

And it works like charm if i run it from browser , but i am wonder how i can implement a wrapper for it to call it from python

2- I am wonder, how i can know if i can send messages to a group or not (like the case where admin sets setting to prevent non admins from sending messages in group) programmatically,or in other words, there is any property that can be fetched from group info that told me if i am restricted to send to a group or not???

I have checked the restricted property from info of a group that i have the rights to send message to and the value of restricted property was false, but also when i tested this on a group where i have no rights to send messages the value it was also false

So i think it is not the property which i am searching about

Any help is appreciated and thank you in advance for any regards