Skip to content

Commit 44f1512

Browse files
authored
Merge pull request #72 from sir1st/master
add http encode for on line QR Code scan
2 parents 27bcf3d + 07e639c commit 44f1512

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

examples/ding-dong-bot.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import os
1717
import asyncio
1818

19+
from urllib.parse import quote
20+
1921
from wechaty import (
2022
Contact,
2123
FileBox,
@@ -49,7 +51,7 @@ async def on_scan(
4951
Scan Handler for the Bot
5052
"""
5153
print('Status: ' + str(status))
52-
print('View QR Code Online: https://wechaty.js.org/qrcode/' + qrcode)
54+
print('View QR Code Online: https://wechaty.js.org/qrcode/' + quote(qrcode))
5355

5456

5557
async def on_login(user: Contact):
@@ -68,6 +70,15 @@ async def main():
6870
# Make sure we have set WECHATY_PUPPET_SERVICE_TOKEN in the environment variables.
6971
# Learn more about services (and TOKEN) from https://wechaty.js.org/docs/puppet-services/
7072
#
73+
# It is highly recommanded to use token like [paimon] and [wxwork].
74+
# Those types of puppet_service are supported natively.
75+
# https://wechaty.js.org/docs/puppet-services/paimon
76+
# https://wechaty.js.org/docs/puppet-services/wxwork
77+
#
78+
# Replace your token here and umcommt that line, you can just run this python file successfully!
79+
# os.environ['token'] = 'puppet_paimon_your_token'
80+
# os.environ['token'] = 'puppet_wxwork_your_token'
81+
#
7182
if 'WECHATY_PUPPET_SERVICE_TOKEN' not in os.environ:
7283
print('''
7384
Error: WECHATY_PUPPET_SERVICE_TOKEN is not found in the environment variables

0 commit comments

Comments
 (0)