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

Warning at first run #19

Closed
realtebo opened this issue Jun 30, 2018 · 23 comments
Closed

Warning at first run #19

realtebo opened this issue Jun 30, 2018 · 23 comments

Comments

@realtebo
Copy link

I'm trying for the first time this project. Great idea and great work !

I cloned, installed npm packages, and simply run it

I got

$ node mybot.js
14:44:07 WARN Wechaty init() DEPRECATED and will be removed after Jun 2018. Use start() instead.
14:44:07 INFO Wechaty v0.13.93 starting...
(node:8072) UnhandledPromiseRejectionWarning: TypeError: rxjs.interval is not a function
    at ThrottleSubscriber.durationSelector (D:\wechaty-getting-started\node_modules\rx-queue\bundles\rx-queue.umd.js:181:99)
    at ThrottleSubscriber.tryDurationSelector (D:\wechaty-getting-started\node_modules\rxjs\operators\throttle.js:107:25)
    at ThrottleSubscriber._next (D:\wechaty-getting-started\node_modules\rxjs\operators\throttle.js:92:33)
    at ThrottleSubscriber.Subscriber.next (D:\wechaty-getting-started\node_modules\rxjs\Subscriber.js:93:18)
    at Subject.next (D:\wechaty-getting-started\node_modules\rxjs\Subject.js:55:25)
    at ThrottleQueue.next (D:\wechaty-getting-started\node_modules\rx-queue\bundles\rx-queue.umd.js:185:26)
    at PuppetWeb.on.data (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\puppet-web.js:74:60)
    at PuppetWeb.emit (events.js:187:15)
    at PuppetWeb.EventEmitter.emit (domain.js:442:20)
    at PuppetWeb.emit (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet.js:34:22)
    at Watchdog.dog.on.food (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\puppet-web.js:102:20)
    at Watchdog.emit (events.js:182:13)
    at Watchdog.EventEmitter.emit (domain.js:442:20)
    at Watchdog.feed (D:\wechaty-getting-started\node_modules\watchdog\bundles\watchdog.umd.js:188:18)
    at PuppetWeb.puppet.on.food (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\puppet-web.js:98:43)
    at PuppetWeb.emit (events.js:182:13)
    at PuppetWeb.EventEmitter.emit (domain.js:442:20)
    at PuppetWeb.emit (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet.js:34:22)
    at PuppetWeb.<anonymous> (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\event.js:53:14)
    at Generator.next (<anonymous>)
    at fulfilled (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\event.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8072) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside o
f an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8072) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections tha
t are not handled will terminate the Node.js process with a non-zero exit code.

@realtebo
Copy link
Author

After QR scan and login, I got

14:46:43 ERR PuppetWebBridge init() initPage() onLoad() exception: Error: Per salvaguardare la sicurezza del tuo account, l'
accesso a WeChat via Web è stato sospeso. Puoi accedere a WeChat per Windows o a WeChat per Mac su un computer. Scarica WeCh
at per Windows o Mac all'indirizzo http://wechat.com.
14:47:09 WARN PuppetWeb initWatchdogForPuppet() dog.on(reset) last food:[object Object], timeout:60000
(node:8072) UnhandledPromiseRejectionWarning: Error: Per salvaguardare la sicurezza del tuo account, l'accesso a WeChat via
Web è stato sospeso. Puoi accedere a WeChat per Windows o a WeChat per Mac su un computer. Scarica WeChat per Windows o Mac
all'indirizzo http://wechat.com.
    at Bridge.<anonymous> (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\bridge.js:175:27)
    at Generator.next (<anonymous>)
    at fulfilled (D:\wechaty-getting-started\node_modules\wechaty\dist\src\puppet-web\bridge.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8072) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside o
f an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
14:47:09 WARN PuppetWebBridge quit() page.close() exception: Error: Protocol error: Connection closed. Most likely the page
has been closed.

The point here is at:

"Per salvaguardare la sicurezza del tuo account, l'
accesso a WeChat via Web è stato sospeso. Puoi accedere a WeChat per Windows o a WeChat per Mac su un computer. Scarica WeCh
at per Windows o Mac all'indirizzo http://wechat.com."

saying that wechat is no more awailable via web....

Is this project still working?

@huan
Copy link
Member

huan commented Jul 1, 2018

Hello @realtebo,

Thanks for using Wechaty.

This repository is for Wechaty v0.14 or before, and it works well when your Wechat account is old enough(new Wechat account will not be permitted to login via web anymore).

If you want to use Wechaty with your new account, please have a look at wechaty/wechaty#1296, we can support Pad Protocol after Wechaty v0.15.

Good luck!

@huan
Copy link
Member

huan commented Jul 1, 2018

@lijiarui Could you please fix this repository so that it will be ok with the latest version of Wechaty?

Because if it's keeping outdated, there will be lots of unnessary confusing for new developers who want to use Wechaty, which will make them waste time, and also no good for adaptering Wechaty to the community.

@huan huan added the question label Jul 1, 2018
@realtebo
Copy link
Author

realtebo commented Jul 1, 2018

@zixia : thanks, the first problem is gone away.

I refer to:

4:44:07 INFO Wechaty v0.13.93 starting...
(node:8072) UnhandledPromiseRejectionWarning: TypeError: rxjs.interval is not a function

I fixed using npm install wechaty@0.14 --save.

About "Pad Protocol" , what it this? Can you point me to more info?
And, can i install wechaty@0.15 ?

@realtebo
Copy link
Author

realtebo commented Jul 1, 2018

  1. I appliead for developer program at Chatie/wechaty#1296
  2. We are already at 0.17 ?!!
    I now understand that this getting started is too old to be a good starting point and I will move to the other repo. So I close issue here and retry from scratch using info at the main repo.

@realtebo realtebo closed this as completed Jul 1, 2018
@huan
Copy link
Member

huan commented Jul 1, 2018

@realtebo Welcome to v0.17! ;-)

@lijiarui had just published a great article on https://blog.chatie.io, talking about how to migrate Wechaty v0.14 to v0.16, I'd like to recommend you to read it, and hope that could help you more.

See: Porting Code From Puppeteer To Padchat

@realtebo
Copy link
Author

realtebo commented Jul 1, 2018

Thanks again. The post you pointed me to is not a good starting point for newbie, because it's full of terms without explanations and it points to external content that point to external content that point to ... [etc... ]

Please, what follows is not a polemic, I'd like just to illustrate what panic I feel when trying to get right info.

TL;DR : we need a page (not a blog post that will disappear down into a page after new contents posted), but a PAGE, with:

  • what the project do
  • HOW the project is using chrome headless via the puppeteer and why it's no more working for new accounts
  • What the project is trying to fix the problem, explain WHAT are all of the strange terms we see uses regularry
  • What to do now to really getting started, WITHOUT deviating user too much to different pages

The long version.

I try to open the blog talking to migrations v.14 o v.16.
Why must I read this? I never write a line of code using your framework?
But I open, and read

Puppet System means to connect Wechaty API to any kinds of Puppets

What are these? ?!?! I want to use the api, but must I to connect to something before use it? If yes, why? If no, really, why to tell advanced features to a newbie?

when I run into

2. How to run puppet-padchat
Wechaty will start with puppeteer(web solution) by default, if you want to change to padchat, you need to set the environmental variable. 

I must leave page

See more in wechaty wiki: How to run a new wecahty-puppet-padchat"

In the target page (https://github.com/Chatie/wechaty/wiki/Puppet#2-run) I can see thhis

Using puppet-padchat to run ding-dong-bot
WECHATY_PUPPET=padchat npm run demo

So, if it is just question of a row, why don't include in the tutorial?

But as newbie I am being distracted from subsequent text

2.1 How to run a new wecahty-puppet-padchat
NPM
1. Install
npm install wechaty@next
2. Run
Get WECHATY_PUPPET_PADCHAT_TOKEN from #1296

Set WECHATY_PUPPET_PADCHAT_TOKEN and Set WECHATY_PUPPET=padchat

3. Start Command
WECHATY_PUPPET_PADCHAT_TOKEN=your padchat token WECHATY_PUPPET=padchat   node examples/ding-dong-bot.js

So think that the section 2 is useless because instead I must follow the section 2.1 ... and then I must read the issue wechaty/wechaty#1296 , so I am two page away for the starting point of reading

So I make me courage and scan the QR, fill the form ( wechaty/wechaty#1296 (comment)) and see in my wechat that our chat bot acepted me into , but it writes in chinese (except where you ask me the secret code but i've no idea of what is and where to get it ...

Ok, long press and wechat translate me the message into a not-readable english, but I understand that the bot needs a secret code ... I'll wait to receive into my mail.

The first point is to remove the text

  1. How to run puppet-padchat
    Wechaty will start with puppeteer(web solution) by default, if you want to change to padchat, you need to set the environmental variable

Warn the user that actually the web solution is not working so it's mandatory to wait for a new release or join to an alpha program . And again, what damn is a puppet!? and what is padchat ? and what is

Going on reading, I read about

Using TSLint

Is it needed? Or is it pre-included when installing wechat?

Why there are 3 versions around ? 0.14, 0.16 and 0.17 ('next', I suppose) .

Sorry, again for long post and please trust me: It's not polemic, it to warn the team that actually the is not a starting point to start from.

I tried with the wiki on the main repo (i think it's the main repo): https://github.com/Chatie/wechaty/wiki

but the getting start page ( https://github.com/Chatie/wechaty/wiki/GettingStarted ) has a broken link to the intro video and just above there is no the good old step by step text .. no , the instr ctuions starts from docker, before examples and api..

I know docker, but it's not the starting point, it's the best practice. If we are not able to run locally using node, we cannot even think of start using it inside a docker

So I skipped docker to see Example page, but this page doesn't exists at all.

So I say me "look at the code", and jump to : https://github.com/Chatie/wechaty/tree/master/examples

Ok., there is a readme without instructions on how to run the examples...

And the readme points to https://github.com/Chatie/wechaty/wiki/API that is declared as a deprecated page

... sorry again, please, forgive me for my approach if it hurts ... I'm very happy to have found this project, and thank you a lot for all the hard, and long, work and for open sourced it.

But it need a really clear step-by-step entry point with:

  • what is
  • how to run the first project using javascript or using typescript, warning that for new accounts it will not works
  • what to do for new accounts

and a bridge from 'entry' a 'api docs' with concepts and term explanations, and background...

@huan huan added the bug label Jul 1, 2018
@huan
Copy link
Member

huan commented Jul 1, 2018

Hi @realtebo,

Thank you so much for posting this long comments/reviews for our project documentation, and I have to agree with you that we need ONE PAGE to help a newbie for Wechaty to get started easily!

As you said, it should straightforward and focus on getting started, without any advanced information. It should introduce the background, concepts, APIs, and keep short and easy to read.

I'm planning to write this kind of page for a long time, but because I'm too familiar with Wechaty, so your comments about the document are really helpful.

I'll write an outline later, and I'd like to show you the outline before continue to fill out the details, because this page is exactly what you need, and I need to make sure you are satisfied with it.

Thank you again for your feedback, looking forward to talking with you soon!

@huan huan reopened this Jul 2, 2018
@huan
Copy link
Member

huan commented Jul 2, 2018

Hello @realtebo,

I had rewritten the README of this repository, with the points we had discussed in this thread, and also try to keep it as simple as possible.

Could you please have a look at it, and tell me what you think about the new version?
https://github.com/lijiarui/wechaty-getting-started

Please feel free to let me know if you think there's any part should be add/del/modify-ed.

Thank you very much!

@realtebo
Copy link
Author

realtebo commented Jul 2, 2018

Very good work ! Thanks.

There is only a little addition I suggest: this system is different from telegram bot api, when you create a new entity from scratch.

Your framework allow to create a software that impersonate an already existing real account.

But I do not know if this Is right. I see in the code the ability to log in via username and password, so probably I can create an account from scratch and do not need to scan the qr .... but I've not tried yet, because I'm here exactly to find a bot that act like an avatar of me

@huan
Copy link
Member

huan commented Jul 3, 2018

Yes, you are right.

Some of the puppet(Wechaty Puppet, specifically) has the ability to login via username and password, as you see in the code. However, I have no plan to add an API to enable login via username and password yet, because of the following three reasons:

  1. some of the puppets do not have the ability to do that, for example, PuppetWechat4u, which is using the Web API;
  2. when you log in by scan QR Code, you can keep your session on your phone, which means you can use WeChat at the same time when your Bot is online; If you login in by username/password, then all other login sessions will be terminated, only your Bot can use WeChat.
  3. as you have already seen, we are using a Protocol Server to control the iPad WeChat. If you want to use username/password to log in, then you will have to send that sensitive information to a 3rd party server, which will not be comfortable for most people.

As your suggestion about the addition to the README: could you please send a PR to modify it so that you can feel comfortable? Because it will be very helpful if you could help me to fix some part of it.

@suntong
Copy link
Contributor

suntong commented Jul 4, 2018

@zixia, please copy what you've written, why not to log in via username and password, into the wiki/faq.
This info is too valuable to be burried & lost in a issue later on.

@huan
Copy link
Member

huan commented Jul 4, 2018

@suntong I agree with you that this should put into the FAQ.

Would you like to add it by yourself? Because the wechaty/wiki is open to the community, and any valuable addition is welcome.

@suntong
Copy link
Contributor

suntong commented Jul 4, 2018

I cannot access the .md source that you put up there, but for this simple task, sure I'll do it.
(I know the wechaty/wiki is open to the community, and have already made some changes I deem necessary...)

@huan
Copy link
Member

huan commented Jul 4, 2018

Thank you very much, appreciate it.

@suntong
Copy link
Contributor

suntong commented Jul 5, 2018

Done:
https://github.com/Chatie/wechaty/wiki/FAQ#why-login-via-scanning-the-qrcode-instead-of-just-username-and-password

@huan
Copy link
Member

huan commented Jul 5, 2018

Great work, thanks!

@realtebo
Copy link
Author

realtebo commented Jul 5, 2018

really, good works @suntong 👍

Can you explain what do you mean by .

we are using a Protocol Server to control the iPad WeChat

I know (now) that this project offers code to interface with a server (your and closed) to act like a bridge ... but what is "iPad WeChat" and how do you control what ? ...

@suntong
Copy link
Contributor

suntong commented Jul 5, 2018

Telling from https://github.com/Chatie/wechaty/wiki/Puppet#11-core-directory, my understanding is

  • "iPad WeChat" A iPad solution to connect WeChat through WeChat-iPad Protocol Server, see padchat-sdk link there.
  • About "control what", your wechaty is still controlling the WeChat session automatically, just like any wechaty based code/projects do, but it does the control via WeChat-iPad Protocol Server, just one of many different ways to control the WeChat session.

See https://github.com/Chatie/wechaty/wiki/Puppet#11-core-directory for details.
And also, https://blog.chatie.io/wechaty-new-release-version-0.16/, especially the link in

Learn more about how to use the PuppetPadchat from Wechaty v0.15 Alpha Testing: Win32/iPad/Android/iOS/API Puppets Support are comming! #1296

@realtebo
Copy link
Author

realtebo commented Jul 5, 2018

@suntong : thanks

From my newbie point of view this first phrase is useless, give me no info,

A iPad solution to connect WeChat through WeChat-iPad Protocol Server, see padchat-sdk link there.

"iPad solution" is .. what? an app on a phisical iPad? or it's just smoke ... I understand just this:

"iPad WeChat" is something we do in someway that we don't explain, and this server is related to iPad world in a way I don't tell you, to bridge your connection to wechat servers in a way we don't tell you .

Thanks again for all the works, but I'm only looking for infos and this pieces of text doesn't help me.

it does the control via WeChat-iPad Protocol Server, just one of many different ways to control the WeChat session.

What is a WeChat-iPad Protocl Server? Is the RPC server we use in the alpha ? or what?

Anyway, I love this project, and I'm so curios ! Please, forgive me for my impatience, but I need, or .. I'd like, clarifications that I've not found yet.

For what I understand, the code of https://github.com/lijiarui/wechaty-puppet-padchat/ is what wechaty uses to connect to their "middleware" server... So stilll I don't know how to connect TO wechat.

About padchat-sdk, thanks 👍 , I'll give it another chance.
But

Description
Padchat development kit. Log in and operate WeChat through the websocket protocol and the WeChat ipad protocol service program running on the Windows platform.

What is the WeChat ipad protocol service program running on the Windows platform ?

Their demo start with

const  url      =  ' ws://host:7777 '

Of course, I already dissected Wechat app for Windows enough to be sure that the Windows version of Wechat do not use websocket at all, so ... what ... ?

@huan
Copy link
Member

huan commented Jul 16, 2018

@realtebo @suntong Thank you very much for all the feedback and discussions.

I believe with the current wechaty-getting-started repository(this repo), the beginners should be easier to run wechaty, and we hope it's an out-of-the-box task.

Is there have any other improvement we should do on this repo? if no, can we close this issue for now?

And any future suggestion & feedback will be welcome, thanks again!

@suntong
Copy link
Contributor

suntong commented Jul 16, 2018

Fine with me.
Thanks for all those fantastic changes for people to easily get started.

@huan
Copy link
Member

huan commented Jul 25, 2018

@suntong You are welcome!

I'll close this issue for now, and please let me know if there are any other problems.

@huan huan closed this as completed Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants