-
Notifications
You must be signed in to change notification settings - Fork 346
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 Heartbeat plugin #985
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are so great as always!
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbis04 Could you file a new issue for this and we can trace this later, then I will ignore this part.
Define a variable called `config` where you can specify: | ||
|
||
* `contact`: The contact of the person whom you want to send the emoji (default: **filehelper**) | ||
* `emoji`: Define under `heartbeat`, the emoji to send (default: **爱心**) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change default: **爱心**
to [爱心] - Heartbeat emoji
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated it.
} | ||
``` | ||
|
||
For using with **WhatsApp** you can set the contact in the following format: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you try to introduce WhatsApp here, then I suggest you introduce Wechat and WeCom here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I have updated with filehelper
, I have removed the reference to WhatsApp.
|
||
```ts | ||
const config = { | ||
contact: 'cotact_num@c.us', // contact who will receive the emoji |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest this using default contact filehelper
filehelper
is suitable for Wechat puppet, cotact_num@c.us
is suitable for Whatsapp puppet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbis04 It still show as cotact_num@c.us
here, I think we should change to filehelper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated it now
|
||
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 |
There was a problem hiding this comment.
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:
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">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added the tabs
You can apply a similar concept to add the `Heartbeat` plugin to any of your Wechaty bots. You can learn more about this plugin [here](https://github.com/wechaty/wechaty-plugin-contrib#4-heartbeat). | ||
|
||
## References | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added the video link
ping @sbis04 |
Pls resolve the conflict @sbis04 |
@lijiarui Have made the CI green. |
@lijiarui I have made the suggested changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
And also looking forward for you to file a new issue for the pending part.
@sbis04 Since the @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 |
…bis04/wechaty.js.org into doc-tutorials-plugin-heartbeat
@lijiarui I have converted the image to |
I have added the tutorial for the
Heartbeat
plugin. The page contents are as follows:Tag #891