npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

puppet-padchat-patch

v0.1.11

Published

### What's this for This is a temporary solution for the current `-106` issue which blocks new users to login with `wechaty-puppet-padchat`

Downloads

52

Readme

puppet-padchat-patch

What's this for

This is a temporary solution for the current -106 issue which blocks new users to login with wechaty-puppet-padchat

Please notice:

  • You need to upgrade your wechaty-puppet-padcaht to v0.17.5 or later to use this patch

  • The second parameter is name(or called profile in the past), you need to change it to the one same as your bot

  • Currently you need to restart your application when the auth data get picked, so wechaty could pick up the auth data and use it to login to wechat. reset does not work for this case now, if you reset wechaty when the finish event emitted, you will still get -106 error.

  • With this sulotion, when the user haven't logged in with wechaty before, there could be 3 times qrcode scan, which is not a great experience, but this is just a temporary solution, we are still working on fixing the issue and make everything back to before. If this solution doesn't work for you, please wait paitiently, we will publish new fix later

How to use

Please take a look at /test/dev-test.ts file for a complete example.

/**
 * Hook the -106 failure status here, try to get auth data from separate server
 */
process.on('unhandledRejection', (error) => {
  const { message } = error
  if (message && message.indexOf('unknown status: -106') !== -1) {
    
    const wxid = (message as string).split(' ').slice(-1)[0]
    const padchatPatch = new PadchatPatch(token, name, wxid)
    padchatPatch
    .on('scan', (qrcode, status) => {
      // You need to let the user scan the qrcode again here
      generate(qrcode, { small: true })

      const qrcodeImageUrl = [
        'https://api.qrserver.com/v1/create-qr-code/?data=',
        encodeURIComponent(qrcode),
      ].join('')
      console.log(`[${status}] ${qrcodeImageUrl}\nScan QR Code above to log in: `)
    })
    .on('finish', async () => {
      // restart your application here
    })
    .start()
    return
  }
})