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

Left Navigation Menu #946

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ t.*

.idea
.DS_Store
*/.DS_Store

package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/examples/basic/ding-dong-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You should have `Node.js` installed on your system. If you do not have `Node.js`

:::

The Ding Dong bot is a part of the **Wechaty Getting Started repository**, you can learn how to run this bot locally from [here](../docs/getting-started/running-locally.mdx).
The Ding Dong bot is a part of the **Wechaty Getting Started repository**, you can learn how to run this bot locally from [here](../docs/getting-started/hard-way.mdx).

## Bot demonstration

Expand Down
179 changes: 179 additions & 0 deletions docusaurus/docs/getting-started/hard-way.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
---
title: Running locally
---

<!-- MDX import -->
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

import ShortestChatbots from '../polyglot/transclusions/shortest-chatbots.mdx'

<!-- Pushes a curious reader through the first few minutes of use. -->

You can setup your own server for running locally. Just follow the steps below:

1. Install build tools
1. Clone the **Wechaty Getting Started** repository
1. Install dependencies
1. Run the bot

<ShortestChatbots />

## Requirements

1. [Node.js](https://nodejs.dev/) v12+
1. [Wechaty Puppet Service TOKEN](https://wechaty.js.org/docs/puppet-services/) (if you want to use RPA protocols other than Web)

## 1. Install build tools

### Install Node.js (>=12)

You will need `Node.js` for running the bot. If you do not have `Node.js` installed (or have a version below 12),
then you need to install the latest version of `Node.js` by following the links below:

:::note Node.js installation docs

* [Windows](https://nodejs.org/en/download/package-manager/#windows)
* [Linux\(Debian/Ubuntu\)](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)
* [macOS](https://nodejs.org/en/download/package-manager/#macos)

> Installation guide for `Node.js` in other platforms can be found [here](https://nodejs.org/en/download/package-manager/).

:::

### Install make

You will need `make` for running the **Makefile**, use the command below to install:

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

<TabItem value="linux">

```sh
sudo apt install build-essential
```

</TabItem>
<TabItem value="mac">

```sh
brew install make
```

</TabItem>
<TabItem value="windows">

```sh
choco install make
```

</TabItem>
</Tabs>

## 2. Clone repository

You can clone the [Wechaty Getting Started](https://github.com/wechaty/wechaty-getting-started) repository by following the below command, and navigate to the directory:

```bash
git clone https://github.com/wechaty/wechaty-getting-started
cd wechaty-getting-started
```

## 3. Install dependencies

For installing the required `npm` dependencies run the following:

```bash
# npm install
make install
```

## 4. Run the bot

First, you have to `export/set` the environment variables, and then you can run the bot:

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

<TabItem value="linux">

```bash
export WECHATY_LOG=verbose
export WECHATY_PUPPET=wechaty-puppet-wechat
make bot
# the above is equals to the below command:
# npm start
# or, npx ts-node examples/ding-dong-bot.ts
```

</TabItem>
<TabItem value="mac">

```bash
export WECHATY_LOG=verbose
export WECHATY_PUPPET=wechaty-puppet-wechat
make bot
# the above is equals to the below command:
# npm start
# or, npx ts-node examples/ding-dong-bot.ts
```

</TabItem>
<TabItem value="windows">

```bash
set WECHATY_LOG=verbose
set WECHATY_PUPPET=wechaty-puppet-wechat
make bot
# the above is equals to the below command:
# npm start
# or, npx ts-node examples/ding-dong-bot.ts
```

</TabItem>
</Tabs>

You can install `npx` by using this command:

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

> There are various **Wechaty puppets** available, you can know more about them [here](https://github.com/wechaty/wechaty-getting-started#working-with-different-puppets).

You can see the following result after running:

![demo](/img/docs/getting-started-qrcode.png)

This demo will show all message on the bot.

## Showcase

![Wechaty Developers' Home](/img/friday-qrcode.svg)

Scan the following QR Code in WeChat with secret code _wechaty_, join our **Wechaty Developers' Home**. This group is only for developers.

:::note Friday BOT

Learn more about our open-sourced Friday BOT from our [showcases](showcases/friday-bot.mdx)

:::

## Contact us

You can [join our Gitter](https://gitter.im/wechaty/wechaty) network if you aren’t already a member.
18 changes: 1 addition & 17 deletions docusaurus/docs/getting-started/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,7 @@ import ServiceBadges from '../puppet-services/transclusions/badges.mdx'

<!-- Pushes a curious reader through the first few minutes of use. -->

If you are a total beginner to Wechaty, start from this section.

You can run Wechaty on following platforms:

- [Google Cloud Shell](getting-started/quick-start.mdx)
- [Gitpod](getting-started/quick-start.mdx)
- [Locally on your machine](getting-started/running-locally.mdx)

Wechaty is a RPA (Robotic Process Automation) SDK for Chatbot Makers which can help you create a bot in 6 lines of [JavaScript](https://GitHub.com/Wechaty/wechaty), [Python](https://GitHub.com/Wechaty/python-wechaty/), [Go](https://GitHub.com/Wechaty/go-wechaty/), and [Java](https://GitHub.com/Wechaty/java-wechaty/), with cross-platform support including [Linux, Windows, MacOS](https://github.com/wechaty/wechaty/actions?query=workflow%3ANPM), and [Docker](https://github.com/wechaty/wechaty/actions?query=workflow%3ADocker).

You will learn the following fundamental features of Wechaty in the getting-started tutorials:

- Turn different instant messaging (IM) systems (such as WeChat, Wecom,Whatsapp, Lark,Gitter, and TikTok) account into chatbot.
- Use the chatbot to communicate or do anything on behalf of you.
- Work out of the box on Linux, Mac and Windows.
- Supports all [puppets](../puppet-services) like Wechat, WhatsApp, WeCom, Lark and so on.
- Reply with a `dong` message when it recieves a `ding` message.
With just a few lines of code, your WeChat/Whatsapp account will be turned into a chatbot, a.k.a [Conversational User Interface](https://en.wikipedia.org/wiki/Conversational_user_interface) Automation Software. With the power of the Wechaty [Conversational](../explainations/conversational.md) [RPA](../explainations/rpa.md) technology, your chatbot will have conversations on behalf of you, and can do whatever you want to do.

:::note RPA for Instant Messaging Software

Expand Down
Loading