Skip to content

Running locally (Ding Dong bot) - #888

Merged
lijiarui merged 31 commits into
wechaty:masterfrom
shwetalsoni:running-locally
Jul 8, 2021
Merged

lijiarui merged 31 commits into
wechaty:masterfrom
shwetalsoni:running-locally

Conversation

@shwetalsoni

@shwetalsoni shwetalsoni commented May 23, 2021 •

Copy link
Copy Markdown
Member

Screenshot from 2021-07-07 16-47-07
Screenshot from 2021-07-07 16-47-35
Screenshot from 2021-07-07 16-47-50
Screenshot from 2021-07-07 16-48-04
Screenshot from 2021-07-07 16-48-20
Screenshot from 2021-07-07 16-48-40
Screenshot from 2021-07-07 16-48-53
Screenshot from 2021-07-07 16-51-22
Screenshot from 2021-07-07 16-51-39
Screenshot from 2021-07-07 16-57-57
Screenshot from 2021-07-07 16-58-12
Screenshot from 2021-07-07 16-58-23
Screenshot from 2021-07-07 16-58-38
Screenshot from 2021-07-07 16-58-50
Screenshot from 2021-07-07 16-58-59

@shwetalsoni
shwetalsoni requested a review from a team as a code owner May 23, 2021 17:23
@shwetalsoni shwetalsoni added GSoD 2021 tutorials Related to tutorial docs labels May 23, 2021
@shwetalsoni shwetalsoni mentioned this pull request May 24, 2021
33 tasks done
@shwetalsoni

Copy link
Copy Markdown
Member Author

Tag: #891

@Rohitesh-Kumar-Jain

Copy link
Copy Markdown
Contributor

Is the PR ready to be reviewd? You requested Review, but I believe you are still pushing new commits to the PR

@shwetalsoni

shwetalsoni commented May 25, 2021 via email

Copy link
Copy Markdown
Member Author

@lijiarui lijiarui mentioned this pull request Jul 6, 2021

@lijiarui lijiarui left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I running this locally, here is the suggestion:

1. change the file name

If our title is Running locally,how about we change the title to getting-started/running-locally.mdx

2. Fix CodeSandbox error

image

I run this locally and found error here, I think you should fix this error fist.

@lijiarui lijiarui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change as I request.

"dotenv": "^8.2.0",
"qrcode-terminal": "^0.12.0",
"wechaty": "^0.60.3",
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change adding dependencies way from adding to package.json to using npm install

maybe change something like this:

npm install wechaty

If you want to show qr-code at the terminal, you can add this:

npm install qrcode- terminal

We may not use dotenv here because this is not the requisite package when using wechaty

"wechaty-puppet-wechat4u": "^0.18",
"wechaty-puppet-whatsapp": "0.2.3"
}
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change adding dependencies way from adding to package.json to using npm install

may change something like this:

You can install wechaty-puppet as you like when using wechaty:

  1. If young want to use whatsapp,you can install wechaty-puppet-whatsapp
npm install wechaty-puppet-whatsapp
  1. If you want to use wechat, you can install wechaty-puppet-wechat
npm install wechaty-puppet-wechat
  1. If you want to use wecom, you can install wechaty-puppet-wxwork
npm install wechaty-puppet-wxwork

You can find more puppet information here: https://wechaty.js.org/docs/puppet-providers/

"wechaty-puppet-mock": "^0.28.2",
"wechaty-puppet-wechat": "^0.28",
"wechaty-puppet-wechat4u": "^0.18",
"wechaty-puppet-whatsapp": "0.2.3"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can delete this pakcage.json part, since it is not necessary for users.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted package.json


```sh
npm install
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reomve npm install here, because we already use npm install XXX before

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


### 6. Defining scripts

You have to define the script for running the bot. Add the following to your `package.json` file:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an enhancement feature, I'd rather to remove this from the tutorial. If you strongly want to add it here, maybe you can tell the reader about this.

We can change this something like this:

If you want to run it more conveniently, you can add some script in package.json.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@lijiarui

lijiarui commented Jul 6, 2021

Copy link
Copy Markdown
Member

I think you can refer to this PR when telling people how to use wechaty: https://github.com/wechaty/wechaty.js.org/pull/905

@shwetalsoni
shwetalsoni requested a review from a team as a code owner July 7, 2021 11:11
@shwetalsoni

Copy link
Copy Markdown
Member Author

@lijiarui I have applied all the requested changes except the code sandbox. I have attached screenshots for clearance.
@sbis04 Can you please help me with code sandbox error. I tried but couldn't fix it.

@lijiarui lijiarui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

One more tips to fix.


```sh
npm install -g npx
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove npm install npx here, because node has npx itself.

@lijiarui

lijiarui commented Jul 7, 2021

Copy link
Copy Markdown
Member

@lijiarui I have applied all the requested changes except the code sandbox. I have attached screenshots for clearance.
@sbis04 Can you please help me with code sandbox error. I tried but couldn't fix it.

@sbis04 you can click here: https://codesandbox.io/s/github/wechaty/wechaty-getting-started/tree/master/examples/third-parties/codesandbox?hidenavigation=1&module=%2Fding-dong-bot.ts&theme=dark and will found error as well. Pls help @shwetalsoni fix this.

@shwetalsoni

Copy link
Copy Markdown
Member Author

@lijiarui I have applied the above requested change.

@lijiarui

lijiarui commented Jul 7, 2021

Copy link
Copy Markdown
Member

Good job, I think you can file a new issue about the sandbox problem, and I will approve this PR.

@shwetalsoni

Copy link
Copy Markdown
Member Author

Good job, I think you can file a new issue about the sandbox problem, and I will approve this PR.

Do you mean to create an issue under Issues?

@shwetalsoni

Copy link
Copy Markdown
Member Author

@lijiarui I have created issue #1032 for keeping the record of all the features that need to be added later mentioning all the respective PR's.

@lijiarui
lijiarui merged commit bf61c15 into wechaty:master Jul 8, 2021
lijiarui added a commit that referenced this pull request Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoD 2021 tutorials Related to tutorial docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants