-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
How to run hot-import-bot example #1222
Labels
Comments
suntong
changed the title
How to run hot-import-bot examples
How to run hot-import-bot example
May 22, 2018
Will have a look into this after I finish the v0.15 |
Alright then. thx. |
I had just tested it with the following commands, it works without any problem: ┌ zixia@zixia-desktop:~/chatie/wechaty/examples/hot-import-bot [16:16:17] tty:[0] jobs:[0]
└ {master} $ pwd
/home/zixia/chatie/wechaty/examples/hot-import-bot
┌ zixia@zixia-desktop:~/chatie/wechaty/examples/hot-import-bot [16:16:22] tty:[0] jobs:[0]
└ {master} $ ll
total 16
-rw-r--r-- 1 zixia 1400 Mar 12 21:58 index.js
drwxr-xr-x 2 zixia 4096 Mar 12 21:58 listeners/
-rw-r--r-- 1 zixia 744 Feb 26 12:39 README.md
-rwxr-xr-x 1 zixia 164 May 27 16:15 run-hot-import-bot.sh*
┌ zixia@zixia-desktop:~/chatie/wechaty/examples/hot-import-bot [16:16:22] tty:[0] jobs:[0]
└ {master} $ cat run-hot-import-bot.sh
#!/usr/bin/env bash
set -e
docker run -t -i --rm --name wechaty -e WECHATY_LOG="$WECHATY_LOG" --mount type=bind,source="$(pwd)",target=/bot zixia/wechaty index.js
┌ zixia@zixia-desktop:~/chatie/wechaty/examples/hot-import-bot [16:16:40] tty:[0] jobs:[0]
└ {master} $ WECHATY_LOG=verbose ./run-hot-import-bot.sh
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
____ _ _
/ ___|___ _ __ _ __ ___ ___| |_(_)_ __ __ _
| | / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | | __/ (__| |_| | | | | (_| |
\____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
|___/
____ _ _ ____ _
/ ___| |__ __ _| |_| __ ) ___ | |_ ___
| | | '_ \ / _` | __| _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
\____|_| |_|\__,_|\__|____/ \___/ \__|___/
Starting Wechaty v0.13.70 with Node.js v9.5.0 ...
Working directory: /bot
Executing babel-node --presets env index.js
08:16:45 INFO Config registering process.on("unhandledRejection") for development/debug
08:16:45 VERB Config constructor()
08:16:47 VERB Wechaty contructor()
08:16:47 VERB Profile constructor(null)
08:16:47 VERB Wechaty on(friend, ./listeners/on-friend) registered
08:16:47 VERB Wechaty onModulePath() hotImpor(/bot/listeners/on-friend)
08:16:47 VERB Wechaty on(login, ./listeners/on-login) registered
08:16:47 VERB Wechaty onModulePath() hotImpor(/bot/listeners/on-login)
08:16:47 VERB Wechaty on(message, ./listeners/on-message) registered
08:16:47 VERB Wechaty onModulePath() hotImpor(/bot/listeners/on-message)
08:16:47 VERB Wechaty on(scan, ./listeners/on-scan) registered
08:16:47 VERB Wechaty onModulePath() hotImpor(/bot/listeners/on-scan)
08:16:47 INFO Wechaty v0.13.70 starting...
08:16:47 VERB Wechaty puppet: web
08:16:47 VERB Wechaty profile: undefined
08:16:47 VERB Wechaty uuid: 6a6756b9-3260-4b25-99f0-f9e0d2af733c
08:16:47 VERB StateSwitch <Wechaty> on(pending) <- (false)
08:16:47 VERB Profile load() file: null
08:16:47 VERB Profile load() no file, NOOP
08:16:47 VERB Wechaty initPuppet()
08:16:47 VERB Wechaty initPuppet() puppet.on(error) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(friend) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(heartbeat) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(login) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(logout) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(message) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(room-join) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(room-leave) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(room-topic) registered
08:16:47 VERB Wechaty initPuppet() puppet.on(scan) registered
08:16:47 VERB Config puppetInstance(PuppetWeb)
08:16:47 VERB PuppetWeb init() with Profile<null>
08:16:47 VERB StateSwitch <Puppet> on(pending) <- (false)
08:16:47 VERB PuppetWeb initWatchdogForPuppet()
08:16:47 VERB PuppetWeb initWatchdogForScan()
08:16:47 VERB PuppetWeb initBridge()
08:16:47 VERB PuppetWebBridge constructor()
08:16:47 VERB PuppetWebBridge init()
08:16:47 VERB StateSwitch <PuppetWebBridge> on(pending) <- (false)
08:16:47 VERB PuppetWebBridge initBrowser()
08:16:47 VERB PUppetWebBridge initBrowser() version: HeadlessChrome/65.0.3312.0
08:16:47 VERB PuppetWebBridge init() initBrowser() done
08:16:47 VERB PuppetWebBridge initPage()
08:16:47 VERB Profile get(cookies)
08:16:47 VERB PuppetWebBridge cookieDomain(undefined)
08:16:47 VERB PuppetWebBridge initPage() before page.goto(url)
08:16:48 VERB PuppetWebBridge initPage() after page.goto(url)
08:16:48 VERB PuppetWebBridge initPage() on(load) https://wx.qq.com/
08:16:48 VERB PuppetWebBridge readyAngular()
08:16:48 VERB PuppetWebBridge inject()
08:16:48 VERB PuppetWebBridge ding(ding() OK!)
08:16:48 VERB PuppetWebBridge clickSwitchAccount()
08:16:48 VERB PuppetWebBridge clickSwitchAccount() listXpath()
08:16:48 VERB StateSwitch <PuppetWebBridge> on(true) <- (pending)
08:16:48 VERB PuppetWebBridge init() initPage() done
08:16:48 VERB PuppetWeb initBridge() done
08:16:48 VERB StateSwitch <Puppet> on(true) <- (pending)
08:16:48 VERB PuppetWeb init() done
08:16:48 VERB Wechaty on(heartbeat, function) registered
08:16:48 VERB Wechaty onFunction(heartbeat)
08:16:48 VERB StateSwitch <Wechaty> on(true) <- (pending)
08:16:49 VERB PuppetWebEvent onScan({code: 0, url: https://login.weixin.qq.com/qrcode/QelXt2S5Ig==})
08:16:49 VERB Profile set(cookies, [object Object],[object Object],[object Object])
08:16:49 VERB Profile save() file: null
08:16:49 VERB Profile save() no file, NOOP
08:16:49 VERB Wechaty init() throttleQueue.subscribe() new item: [object Object]
0 'https://login.weixin.qq.com/qrcode/QelXt2S5Ig=='
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀ ▀ █ ██▀█▄▄█ ▄▄▄▄▄ █
█ █ █ █ █▀▄▀▄ ▀ ▄▀█ █ █ █
█ █▄▄▄█ █▄█▀ ▄ █▄▄▀▀ ██ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄█ █ █ ▀ ▀▄▀▄█▄▄▄▄▄▄▄█
█▄ ▄▄▀▀▄▀▄█ ▄ ▄▄▄ ▄ ▀█ ▀▀ ▄▄█ █
█▄ ▄▀█▄ ▀ ▄▄ ██▀█▀█ ▄▄█▀█▄▄▀█
█▀█▄▀▀▀▄▀▄ ▄▀ █▄█ ▄█ █▄▀██▄ ▀▀█
█▀▀ ▄█ ▄▄▀ █▄▀▀█▄▄▄▄ ▀ █▄ ▄█
██▀ ██▄▄█ ▄▀█▄▄ █▄▀▄▄ █ ▄ ▀ ██
█▄█▀▄▀█▄█▀▀▀▀██▄▄▀▀▀█▀▀▀▄▀█ ███
██▄▄▄▄█▄▄ ▀▀██▀▀█ ▀▀ ▄▄▄ ▀▀█
█ ▄▄▄▄▄ ██▀▀▀▀▀▀█ █ ▄ █▄█ █▄██
█ █ █ █▀▀▀ █▀▀▄▀▄█▀ ▄ ▀▄▄ █
█ █▄▄▄█ █ █▄█ ▀▄█▀█ ▄ ██▄▀▀▄▀▄█
█▄▄▄▄▄▄▄█▄▄█▄███▄███▄▄▄██▄██▄██
08:16:49 VERB Profile set(cookies, [object Object],[object Object],[object Object])
08:16:49 VERB Profile save() file: null
08:16:49 VERB Profile save() no file, NOOP
^C Script terminated by Control-C
____ _ _ ____
/ ___| |_ _ __| | _ / ___|
| | | __| '__| | _| |_ | |
| |___| |_| | | | |_ _| | |___
\____|\__|_| |_| |_| \____|
__ __ _ _
\ \ / /__ ___| |__ __ _| |_ _ _
\ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
\ V V / __/ (__| | | | (_| | |_| |_| |
\_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|___/
____________________________________________________
https://www.chatie.io
_____ _ _ _ _____ ___
| ____|_ _(_) |_ / |___ / / _ \
| _| \ \/ / | __| | | |_ \| | | |
| |___ > <| | |_ | |___) | |_| |
|_____/_/\_\_|\__| |_|____/ \___/
|
Thanks @zixia, so it can run within docker just fine. How can I make it run under normal command line as well, not within docker but just plain Linux shell? Thx. |
Confirmed that the example cannot be run outside docker. Merge to wechaty/getting-started#37 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was getting the following errors (enclosed in "Show Logs") when running the hot-import-bot examples. Running with
node index.js
will give me the same error as well. What could be wrong? All my tools are of the latest version now:Wechaty is v0.14.4, and
Show Logs
Paste the full output logs here
The text was updated successfully, but these errors were encountered: