Alpaca4610/nonebot-plugin-chatppt

请问大佬这种运行失败是因为什么啊

cchuahua opened this issue · 18 comments

04-17 23:04:10 [DEBUG] nonebot | Running PreProcessors...
04-17 23:04:10 [DEBUG] nonebot | Checking for matchers in priority 1...
04-17 23:04:10 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot_plugin_chatppt)
04-17 23:04:10 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatppt)
04-17 23:04:10 [DEBUG] nonebot | Running handler Dependent(call=_)
04-17 23:04:10 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_chatppt) running complete
04-17 23:04:10 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatppt) failed.
Traceback (most recent call last):
File "", line 21, in
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "D:\nb\new-bot2.venv\lib\site-packages\uvicorn\main.py", line 568, in run
server.run()
File "D:\nb\new-bot2.venv\lib\site-packages\uvicorn\server.py", line 59, in run
return asyncio.run(self.serve(sockets=sockets))
File "E:\Anaconda\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "E:\Anaconda\lib\asyncio\base_events.py", line 634, in run_until_complete
self.run_forever()
File "E:\Anaconda\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "E:\Anaconda\lib\asyncio\base_events.py", line 601, in run_forever
self._run_once()
File "E:\Anaconda\lib\asyncio\base_events.py", line 1905, in _run_once
handle._run()
File "E:\Anaconda\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot_plugin_chatppt_init_.py", line 65, in _
if slides_limit < int(length):
TypeError: '<' not supported between instances of 'str' and 'int'

你是不是设置了slides_limit?看一下你的配置文件。

ENVIRONMENT=dev
DRIVER=~fastapi
SUPERUSER=["908"]
NICKNAME=["hua"]
COMMAND_START=[""]
COMMAND_SEP=["."]
OPENAI_API_KEY = sk-A5TgaWOQNDY0DP
OPENAI_HTTP_PROXY = "http://127.0.0.1:60625" # **大陆/香港IP调用API请使用代理访问api,否则有几率会被封禁
OPENAI_MODEL_NAME = "" # 使用的模型名称
SLIDES_LIMIT = "50" # 生成PPT页数的上限,不设置默认为10
key部分删除了一些

ENVIRONMENT=dev
DRIVER=~fastapi
SUPERUSER=["908"]
NICKNAME=["hua"]
COMMAND_START=[""]
COMMAND_SEP=["."]
OPENAI_API_KEY = sk-A5TgaWOQNDY0DP
OPENAI_HTTP_PROXY = "http://127.0.0.1:60625" # **大陆/香港IP调用API请使用代理访问api,否则有几率会被封禁
OPENAI_MODEL_NAME = "" # 使用的模型名称
SLIDES_LIMIT = "50" # 生成PPT页数的上限,不设置默认为10
key部分删除了一些

50那的引号去掉

还是不行啊

重启过了也不行

还是不行啊

把OPENAI_MODEL_NAME = "" # 使用的模型名称这一行删掉看看,如果还不行提供一下报错信息

04-17 23:45:45 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatppt) failed.
Traceback (most recent call last):
File "", line 21, in
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot_init_.py", line 309, in run
get_driver().run(*args, **kwargs)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 198, in run
uvicorn.run(
File "D:\nb\new-bot2.venv\lib\site-packages\uvicorn\main.py", line 568, in run
server.run()
File "D:\nb\new-bot2.venv\lib\site-packages\uvicorn\server.py", line 59, in run
return asyncio.run(self.serve(sockets=sockets))
File "E:\Anaconda\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "E:\Anaconda\lib\asyncio\base_events.py", line 634, in run_until_complete
self.run_forever()
File "E:\Anaconda\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "E:\Anaconda\lib\asyncio\base_events.py", line 601, in run_forever
self._run_once()
File "E:\Anaconda\lib\asyncio\base_events.py", line 1905, in _run_once
handle._run()
File "E:\Anaconda\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\message.py", line 187, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 753, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\internal\matcher\matcher.py", line 728, in simple_run
await handler(
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "D:\nb\new-bot2.venv\lib\site-packages\nonebot_plugin_chatppt_init_.py", line 65, in _
if slides_limit < int(length):
TypeError: '<' not supported between instances of 'str' and 'int'
这就是全部的报错信息了,麻烦大佬了

if slides_limit < int(length):
await start_request.finish(MessageSegment.text(f"生成的PPT不能超过{slides_limit}页!"), at_sender=True)
是这一段的信息吗文件 “D:\nb\new-bot2.venv\lib\site-packages\nonebot_plugin_chatppt_init_.py”,第 65 行,
在 _ 如果 slides_limit < int(length):从这个找到的,需要修改什么吗

估计是页数限制的问题,我本地调试一下看看,你暂时先把页数限制这个配置删除用着。我后续更新一个版本看看。

这两行直接删了?

if slides_limit < int(length):
await start_request.finish(MessageSegment.text(f"生成的PPT不能超过{slides_limit}页!"), at_sender=True)
是这一段的信息吗文件 “D:\nb\new-bot2.venv\lib\site-packages\nonebot_plugin_chatppt_init_.py”,第 65 行,
在 _ 如果 slides_limit < int(length):从这个找到的,需要修改什么吗

你可以把slides_limit < int(length)改成int(slides_limit) < int(length)试试

if slides_limit < int(length):
await start_request.finish(MessageSegment.text(f"生成的PPT不能超过{slides_limit}页!"), at_sender=True)
是这一段的信息吗文件 “D:\nb\new-bot2.venv\lib\site-packages\nonebot_plugin_chatppt_init_.py”,第 65 行,
在 _ 如果 slides_limit < int(length):从这个找到的,需要修改什么吗

你可以把slides_limit < int(length)改成int(slides_limit) < int(length)试试

如果这样还不行的话直接删掉那两行

ok了,加了个int之后

但是另一个问题来了小号 0:03:04
生成中.......

小号 0:03:04
Package not found at './data/nonebot-plugin-chatppt/theme.pptx'
找不到,但是我已经配置并且重命名了,是因为data前面的那个点吗

但是另一个问题来了小号 0:03:04 生成中.......

小号 0:03:04 Package not found at './data/nonebot-plugin-chatppt/theme.pptx' 找不到,但是我已经配置并且重命名了,是因为data前面的那个点吗

data文件夹放在机器人的根目录下

data当然在根目录下,但是就是没能识别,是因为theme.pptx需要特定格式吗,我设置的这个是PowerPoint的演示文稿

theme.pptx是一个pptx格式的PPT文件。你检查一下你这个文件的文件全名是不是theme.pptx。Windows下默认会隐藏文件后缀名。

我脑子瓦特了,直接命名成theme.pptx了,忘了隐藏后缀这个事了