1- ## examples:
1+ ## Examples
22
33* [ setting up] ( #setting-up )
44* [ examples] ( #examples )
55
66
77<a name =" setting-up " ></a >
8- ### setting up:
8+ ### Setting up
99
1010Clone this repository:
1111
@@ -24,28 +24,22 @@ $ cd mau/
2424$ npm install --only=prod
2525```
2626
27- Change into the ` example/ ` directory:
27+ Change into the ` example/ ` directory and install some
28+ additional dependencies are required to run the examples:
2829
2930``` bash
31+ # Change directory.
3032$ cd example/
31- ```
32-
33- Some additional dependencies are required to run the
34- examples. You'll need to install them:
35-
36- ``` bash
37- # For ALL examples.
38- $ npm install tgfancy
3933
40- # For example #2 .
41- $ npm install http-proxy ngrok
34+ # Install additional dependencies .
35+ $ npm install
4236```
4337
4438You will also need [ Redis] [ redis ] for example #2 .
4539
4640
4741<a name =" examples " ></a >
48- ### examples:
42+ ### Examples
4943
5044* [ Example #1 ] ( #example-1 ) : A single Telegram bot
5145* [ Example #2 ] ( #example-2 ) : Multiple Telegram bots
@@ -62,7 +56,7 @@ $ export TELEGRAM_TOKEN=xxxxx
6256
6357# Run the bot.
6458# Leave out 'NO_REDIS=1' if you want to use Redis.
65- $ NO_REDIS=1 node example/ telegram.js
59+ $ NO_REDIS=1 node telegram.js
6660```
6761
6862** Time to Play** : Send your bot a message.
@@ -81,12 +75,12 @@ to be `6379`. Port can be changed using environment variable
8175# In a separate shell, start a bot instance
8276# listening on port 9101.
8377$ export TELEGRAM_TOKEN=xxxxx
84- $ node example/ telegram.js 9101
78+ $ node telegram.js 9101
8579
8680# In another separate shell, start another instance
8781# listening on port 9102.
8882$ export TELEGRAM_TOKEN=xxxxx
89- $ node example/ telegram.js 9102
83+ $ node telegram.js 9102
9084
9185# ... Run more instances if you wish ...
9286
@@ -95,7 +89,7 @@ $ node example/telegram.js 9102
9589# Append the port numbers of any additional instances you have started. Mind the commas.
9690# Leave out `PROXY_PORT=9100` to have proxy listen on its default port i.e. 9100.
9791$ export TELEGRAM_TOKEN=xxxxx
98- $ PROXY_PORT=9100 node example/ proxy.js 9101,9102
92+ $ PROXY_PORT=9100 node proxy.js 9101,9102
9993```
10094
10195** Time to Play** : Send your bot a message.
0 commit comments