Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WechatyOptions.name设置的json文件在哪里? #77

Open
panwudi opened this issue May 1, 2022 · 8 comments
Open

WechatyOptions.name设置的json文件在哪里? #77

panwudi opened this issue May 1, 2022 · 8 comments

Comments

@panwudi
Copy link

panwudi commented May 1, 2022

怎么都找不到?
目前不需要设置也可以不用每次扫码登录,是不是这个属性已经弃用了?

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented May 1, 2022

There is no json file configured in WechatyOption.name field which is to figure out the name of th bot.

So, how do you know there is json file base on WechatyOption?

BTW, if you have the bot logined onece, the bot will keep online until you call bot.logout method.

Please feel free to tell me more.

@panwudi
Copy link
Author

panwudi commented May 2, 2022

截屏2022-05-02 上午10 10 49

accordding to the api doc: Wechaty Name. When you set this: new Wechaty({profile: 'wechatyName'}) it will generate a file called wechatyName.memory-card.json. This file stores the bot's login information. If the file is valid, the bot can auto login so you don't need to scan the qrcode to login again. Also, you can set the environment variable for WECHATY_PROFILE to set this value when you start. eg: WECHATY_PROFILE="your-cute-bot-name" node bot.js. This field is deprecated, please use name instead. https://github.com/wechaty/wechaty/issues/2049

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented May 2, 2022

The above is the docs of ts-wechaty, not python-wechaty. So there are many differences between them.

I suggest that you can take a look at python-wechaty document or the source code of python-wechaty.

@panwudi
Copy link
Author

panwudi commented May 2, 2022

document

Wechaty 类中并没有logout这个方法啊? 源码里面也只有 on_logout

@panwudi
Copy link
Author

panwudi commented May 2, 2022

python-wechaty的文档里也错误的写了机器人登录保存文件
截屏2022-05-02 下午5 20 00

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented May 2, 2022

Yes, the doc of python-wechaty is in a early stage, which will be improved in this summer. So I suggest that you can checkout the source code and example code to get the details about your problem.

@panwudi
Copy link
Author

panwudi commented May 2, 2022

Yes, the doc of python-wechaty is in a early stage, which will be improved in this summer. So I suggest that you can checkout the source code and example code to get the details about your problem.

嗯,谢谢。 另外heartbeat 捕获事件也不生效,不管是在Wechaty基类还是在实例里面的 on_heartbeat 方法中随便插一句输出语句都不生效。 我要如何监控到机器人在正常运行呢?

python学了三周,就为这个机器人现学的,可能问题比较低级。谢谢

@shavingha
Copy link

where do you store login state ??
I have change computer, AND I can autologin too.......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants