sanshanya / hoshino_xcw

自用的PCRBOT,基于hoshino,yobot,mirai,集合了很多插件
GNU General Public License v3.0
226 stars 60 forks source link

内鬼生成报错 #14

Open Zoe-Wh1t3zZ opened 2 years ago

Zoe-Wh1t3zZ commented 2 years ago

File "C:\Users\Administrator\Desktop\HoshinoBot\hoshino\modules\snitchgenerator__init__.py", line 5, in from .nokia import generate_image File "C:\Users\Administrator\Desktop\HoshinoBot\hoshino\modules\snitchgenerator\nokia.py", line 21, in font = ImageFont.truetype("fonts/1.ttf", font_size) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 844, in truetype return freetype(font) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 841, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\ImageFont.py", line 193, in init self.font = core.getfont( OSError: cannot open resource

kcn3388 commented 2 years ago

做如下修改:

import os
...

path = os.path.join(os.path.dirname(__file__), "./fonts/1.ttf")
...