Skip to content
New issue

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

chartEnabled=trueでfont.ttfが配置されていない場合は異常終了する #107

Closed
wants to merge 8 commits into from

Conversation

massongit
Copy link
Contributor

@massongit massongit commented Mar 4, 2023

Fix #110

23:46:19 [AiOS]: [chart]: Chart rendering...
/ai/node_modules/canvas/index.js:48
  return Canvas._registerFont(fs.realpathSync(src), fontFace)
                ^

Error: Could not parse font file
    at Object.registerFont (/ai/node_modules/canvas/index.js:48:17)
    at Object.renderChart (/ai/built/modules/chart/render-chart.js:25:14)
    at default_1.genChart (/ai/built/modules/chart/index.js:119:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async default_1.post (/ai/built/modules/chart/index.js:40:22)

font.ttf を配置せずに chartEnabled: true な状態で起動すると、チャート機能実行時に上記エラーで落ちます。
従って、 chartEnabled: true な場合はbot起動前に font.ttf が配置されているか確認し、入っていなかったら落ちるようにします。
また、READMEの記述にわかりづらい箇所があったため、合わせて修正しています。

@massongit
Copy link
Contributor Author

まず #110 で方針を固めた方が良いのでclose。

@massongit massongit closed this Mar 18, 2023
@massongit massongit deleted the add_put_font_check branch March 18, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chartEnabled=trueでfont.ttfが配置されていない場合は起動しないようにする
1 participant