g1331 / xiaomai-bot

以Graia Ariadne框架为基础的战地1QQ机器人
GNU General Public License v3.0
44 stars 7 forks source link

Fix: Add proxy for drawing picture #37

Closed Ra2-IFV closed 2 weeks ago

Ra2-IFV commented 3 weeks ago

I missed this in previous commit.

Summary by Sourcery

通过添加代理配置来正确处理网络请求,修复绘图功能。

Bug 修复:

Original summary in English ## Summary by Sourcery Fix the drawing picture functionality by adding a proxy configuration to handle network requests correctly. Bug Fixes: - Add a proxy configuration for drawing pictures to ensure proper network requests.
sourcery-ai[bot] commented 3 weeks ago

审核指南由 Sourcery 提供

此拉取请求为 BF1 实用模块的绘图功能添加了代理支持。它引入了一个新的配置选项,用于设置代理,可以在下载资产或执行与绘图功能相关的网络操作时使用。

文件级更改

更改 详情 文件
为网络操作添加代理配置
  • 从 core.config 导入 GlobalConfig
  • 创建 GlobalConfig 的实例
  • 根据配置设置代理变量
  • 如果配置值为 'proxy',则代理设置为空字符串
utils/bf1/draw/__init__.py

提示 - 通过在拉取请求中评论 `@sourcery-ai review` 来触发新的 Sourcery 审核。 - 通过直接回复审核评论继续与 Sourcery 的讨论。 - 您可以随时通过访问您的[仪表板](https://app.sourcery.ai)来更改审核设置: - 启用或禁用 Sourcery 生成的拉取请求摘要或审核指南; - 更改审核语言; - 如果您有任何问题或反馈,您可以随时[联系我们](mailto:support@sourcery.ai)。
Original review guide in English ## Reviewer's Guide by Sourcery This pull request adds proxy support for drawing pictures in the BF1 utility module. It introduces a new configuration option for setting up a proxy, which can be used when downloading assets or performing network operations related to drawing functionality. ### File-Level Changes | Change | Details | Files | | ------ | ------- | ----- | | Add proxy configuration for network operations |
  • Import GlobalConfig from core.config
  • Create an instance of GlobalConfig
  • Set up a proxy variable based on the configuration
  • The proxy is set to an empty string if the config value is 'proxy'
| `utils/bf1/draw/__init__.py` | ---
Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.