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

Add tutorial for EventLogger plugin #963

Merged
merged 13 commits into from
Jul 10, 2021

Conversation

sbis04
Copy link
Contributor

@sbis04 sbis04 commented Jun 18, 2021

I have added the tutorial for the EventLogger plugin. The page contents are as follows:

The updated screenshot of this page is in a comment below.

EventLogger plugin

Tag #891

@sbis04 sbis04 added GSoD 2021 tutorials Related to tutorial docs labels Jun 18, 2021
@sbis04 sbis04 requested review from a team as code owners June 18, 2021 15:15
Copy link
Contributor

@proudofsimin proudofsimin left a comment

Choose a reason for hiding this comment

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

Hi,
This is great. Please just change the v-ing in steps to present tense. Thank you.


This will generate a `node_modules` directory containing all the installed dependencies, and a `package-lock.json` file.

### 4. Writing code for bot
Copy link
Contributor

Choose a reason for hiding this comment

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

Write

bot.start()
```

### 5. Running the bot
Copy link
Contributor

Choose a reason for hiding this comment

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

Run

npm i wechaty-plugin-contrib
```

### 2. Integrating the plugin
Copy link
Contributor

Choose a reason for hiding this comment

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

Integrate

@sbis04
Copy link
Contributor Author

sbis04 commented Jun 20, 2021

@proudofsimin I have changed the -ing(s) in steps to present tense and fixed the title capitalizations.

@sbis04
Copy link
Contributor Author

sbis04 commented Jun 25, 2021

Hi @proudofsimin @Rohitesh-Kumar-Jain in the previous meeting we were confused where to keep the simple bot, so that we can use it to show how to add the plugins.

I and @shwetalsoni discussed about this, and we decided to keep the simple bot inside Examples > Basic > Starter Bot. And, we will show how to add the plugins using this bot.

Sidebar examples basic

The updated Event Logger plugin page looks like this:

Event Logger plugin

## Adding Event Logger plugin

For the demonstration of adding this plugin, we will use the **Starter Bot** and show you how to add the `EventLogger` plugin to it. Follow the steps below:

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, do you think if it's better if we add a step one telling our user to create a simple bot first? Anyway it is still a step they need to do first.

  1. Create a starter bot

Follow the instructions in [Starter bot] to create the the foundation.

  1. Install dependency
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have added step one for telling the users to create a starter bot

Copy link
Contributor

@proudofsimin proudofsimin left a comment

Choose a reason for hiding this comment

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

I love your new organization so much. This is so good!

Copy link
Member

@lijiarui lijiarui left a comment

Choose a reason for hiding this comment

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

Pls change as I request, thanks!


### 1. Create a starter bot

Follow the instructions on the **Starter Bot** page to create the foundation of a Wechaty bot.
Copy link
Member

Choose a reason for hiding this comment

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

I thinks we should add link for **Starter Bot* page and then users can refer that part if he don't know how to build a starter bot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll add the link. Currently, the Starter Bot page isn't there on the docs, we have it further down on our proposal timeline. Once, the page is ready we will also update the link here.


In order to run the bot, first you have to **export/set** an environment variable with the type of puppet to use, and then start the bot:

#### Linux/macOS
Copy link
Member

Choose a reason for hiding this comment

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

I think we should unify the style here, @shwetalsoni did a good job, it looks like this:

image

You can use code like this:

<Tabs
  groupId="operating-systems"
  defaultValue="linux"
  values={[
    { label: 'Linux',   value: 'linux', },
    { label: 'macOS',   value: 'mac', },
    { label: 'Windows', value: 'windows', },
  ]
}>

<TabItem value="linux">

Learn how to integrate [QR Code Terminal Plugin](./qr-code-terminal) to your Wechaty bot in the next tutorial.

## References

Copy link
Member

Choose a reason for hiding this comment

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

Add video link reference here: https://www.youtube.com/watch?v=tfGZXoe_aA4

@lijiarui
Copy link
Member

lijiarui commented Jul 8, 2021

ping @sbis04

@lijiarui
Copy link
Member

lijiarui commented Jul 8, 2021

@sbis04 Pls resolve the conflict, then I will approve this PR.

@sbis04
Copy link
Contributor Author

sbis04 commented Jul 8, 2021

@lijiarui Have made the CI green.

Copy link
Member

@lijiarui lijiarui left a comment

Choose a reason for hiding this comment

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

LGTM

@lijiarui
Copy link
Member

lijiarui commented Jul 10, 2021

@sbis04 Since the .webp format has lots of advantages and the safari has supported it last year which means all the modern browsers will be able to compatible with it.

@huan has just added a new unit test for enforcing the image format: the CI will not be passed if we are using other image formats than the perfect .webp.

Please make CI green to adjust the new rule, see https://github.com/wechaty/wechaty.js.org/issues/1035

@sbis04
Copy link
Contributor Author

sbis04 commented Jul 10, 2021

@lijiarui I have converted the image to .webp format and made the CI green.

@huan huan merged commit fe98170 into wechaty:master Jul 10, 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.

4 participants