wechaty / puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
https://wechaty.js.org/docs/puppet-providers/padlocal
Apache License 2.0
642 stars 88 forks source link

Can't switch Account #44

Closed JellyZhang closed 3 years ago

JellyZhang commented 3 years ago

require("dotenv").config(); const puppet = new PuppetPadlocal({});

const bot = new Wechaty({ name: "TestBot", puppet, });

bot .on("scan", (qrcode: string, status: ScanStatus) => { if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) { generate(qrcode, { small: true }); // show qrcode on console

  const qrcodeImageUrl = [
    //"https://wechaty.js.org/qrcode/",
    "https://api.qrserver.com/v1/create-qr-code/?data=",
    encodeURIComponent(qrcode),
  ].join("");

  log.info(
    "StarterBot",
    "onScan: %s(%s) - %s",
    ScanStatus[status],
    status,
    qrcodeImageUrl
  );
} else {
  log.info("StarterBot", "onScan: %s(%s)", ScanStatus[status], status);
}

})

.on("login", (user: Contact) => { console.log(${user} login); })

.on("logout", (user: Contact) => { console.log(${user} logout); })

.on("message", async (message: Message) => { console.log(on message: ${message.toString()}); if (message.text() === "ding") { await message.say("dong"); } if (message.text() === "esc") { await bot.logout(); } })

.start();

console.log("TestBot", "started");


Thanks for your help.
renph commented 3 years ago

I got a similar issue here. Can not log in with a recently created wechat account

padlocal commented 3 years ago

Fixed.

If this issue is still occurred, contact admin to reset your account.