We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
- wechaty: - wechaty-puppet: - wechaty-puppet-service: - wechaty-plugin-contrib: - token type: padlocal|wxwork|xp - the version of wechaty docker container: [0.65]
ValueError: mutable default <class 'wechaty_puppet.schemas.puppet.PuppetOptions'> for field puppet_options is not allowed: use default_factory
from wechaty import Wechaty, Contact from wechaty.user import Message, Room
class MyBot(Wechaty):
async def on_message(self, msg: Message): """ 监听消息事件 """ if msg.self() or msg.type() != Message.Type.MESSAGE_TYPE_TEXT: # 如果是自己发的消息或者不是文本消息,则不处理 return # 获取消息文本 text = msg.text() # 判断是否是群聊消息 room = msg.room() if room: # 检查是否被@了 if msg.mention_self(): await msg.say('你好,我是测试机器人') else: # 私聊消息直接回复 await msg.say('你好,我是测试机器人')
async def main(): # 初始化机器人 bot = MyBot() # 启动机器人 await bot.start()
import asyncio
if name == 'main': asyncio.run(main())
The text was updated successfully, but these errors were encountered:
完善一下环境所使用库的版本信息,方便问题排查。
Sorry, something went wrong.
No branches or pull requests
Environment
Description
Minimum reproducible code
from wechaty import Wechaty, Contact
from wechaty.user import Message, Room
class MyBot(Wechaty):
async def main():
# 初始化机器人
bot = MyBot()
# 启动机器人
await bot.start()
import asyncio
if name == 'main':
asyncio.run(main())
The text was updated successfully, but these errors were encountered: