mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
* 更新了wechatpad接口,以及适配器 * 更新了wechatpad接口,以及适配器 * 修复一些细节问题,比如at回复,以及启动登录和启动ws长连接的线程同步 * importutil中修复了在wi上启动替换斜杠问题,login中加上了一个login,暂时没啥用。wechatpad中做出了一些细节修改 * 更新了wechatpad接口,以及适配器 * 怎加了处理图片链接转换为image_base64发送 * feat(wechatpad): 调整日志+bugfix * feat(wechatpad): fix typo * 修正了发送语音api参数错误,添加了发送链接处理为base64数据(好像只有一部分链接可以) * 修复了部分手抽的typo错误 * chore: remove manager.py --------- Co-authored-by: shinelin <shinelinxx@gmail.com> Co-authored-by: Junyan Qin (Chin) <rockchinq@gmail.com>
32 lines
759 B
Python
32 lines
759 B
Python
import qrcode
|
|
|
|
def print_green(text):
|
|
print(f"\033[32m{text}\033[0m")
|
|
|
|
def print_yellow(text):
|
|
print(f"\033[33m{text}\033[0m")
|
|
|
|
def print_red(text):
|
|
print(f"\033[31m{text}\033[0m")
|
|
|
|
def make_and_print_qr(url):
|
|
"""生成并打印二维码
|
|
|
|
Args:
|
|
url: 需要生成二维码的URL字符串
|
|
|
|
Returns:
|
|
None
|
|
|
|
功能:
|
|
1. 在终端打印二维码的ASCII图形
|
|
2. 同时提供在线二维码生成链接作为备选
|
|
"""
|
|
print_green("请扫描下方二维码登录")
|
|
qr = qrcode.QRCode()
|
|
qr.add_data(url)
|
|
qr.make()
|
|
qr.print_ascii(invert=True)
|
|
print_green(f"也可以访问下方链接获取二维码:\nhttps://api.qrserver.com/v1/create-qr-code/?data={url}")
|
|
|