Rlezzo / AnimeWife

适用于HoshinoBot的抽二次元老婆插件
2 stars 0 forks source link

求修饰器出处 #1

Open klscrimson opened 5 months ago

klscrimson commented 5 months ago

animewife.py文件70行,@hoshino.get_bot().server_app.before_serving报错,插件开发者文档里也没找到这个修饰器的出处。 运行错误信息如下: File "animewife.py", line 70 @hoshino.get_bot().server_app.before_serving ^ SyntaxError: invalid syntax

Rlezzo commented 4 months ago

具体的我也不太清楚,hoshino好像用的quart.app.before_serving,@app.before_serving,我这反正能用,你看看是不是quart或者hoshino的版本问题?

1011yoshino commented 4 months ago

你把这两段代码 @hoshino.get_bot().server_app.before_serving ... @hoshino.get_bot().server_app.after_serving

改成

bot = hoshino.get_bot() @bot.server_app.before_serving ... @bot.server_app.after_serving

就可以了