我是python新手,我想使用类的实例作为函数的参数,如以下代码:
机器人
from Bot import Qhttp, Event
import func
bot = Qhttp()
@bot.on('message')
async def _Msg(event: Event):
print(event.message)
await func.dosomething(event)
bot.run(hots='0.0.0.0', port=23456)
func.py
async def dosomething(event):
print(event.message)
Qhttp是一个基于Quart开发的对象,用于接收http post信息
message
是事件对象中的字符串
在async def _Msg(event: Event):
中,字符串可以正常打印,但在async def dosomething(event):
中,我无法获取字符串。它打印:
functools.partial(<bound method Qhttp.call_action of <Bot.Qhttp object at 0xMEMORYADDRESS>>, 'message')
如何访问async def dosomething(event):
中的message
字符串
目前没有回答
相关问题 更多 >
编程相关推荐