Skip to content

Fix HITOKOTO parameter boolean/string type handling#2918

Draft
Copilot wants to merge 3 commits into
developfrom
copilot/fix-hitokoto-parameter-issue
Draft

Fix HITOKOTO parameter boolean/string type handling#2918
Copilot wants to merge 3 commits into
developfrom
copilot/fix-hitokoto-parameter-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 29, 2026

The HITOKOTO parameter defaults to boolean True but was only checked against string "false", causing boolean False to incorrectly enable the feature since False != "false" evaluates to True.

Changes

Python (notify.py, notify.py.save):

# Before
content += "\n\n" + one() if hitokoto != "false" else ""

# After
content += "\n\n" + one() if hitokoto not in [False, "false"] else ""

JavaScript (notify.js):

// Before
if (push_config.HITOKOTO !== 'false') {
  desp += '\n\n' + (await one());
}

// After
if (![false, 'false'].includes(push_config.HITOKOTO)) {
  desp += '\n\n' + (await one());
}

Both boolean and string values now correctly control the feature state.

Original prompt

This section details on the original issue you should resolve

<issue_title>参数HITOKOTO设置不生效,获取HITOKOTO参数设置值时为字符串对比,但是设置时是布尔类型。</issue_title>
<issue_description>### Qinglong version

所有版本

Steps to reproduce

参数HITOKOTO设置不生效,获取HITOKOTO参数设置值时为字符串对比,但是设置时是布尔类型。

原代码

push_config = {
    'HITOKOTO': True,                  # 启用一言(随机句子)

...

hitokoto = push_config.get("HITOKOTO")
content += "\n\n" + one() if hitokoto != "false" else ""

What is expected?

需要修改判断正常识别参数配置。

What is actually happening?

System Info

Any additional comments?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
qinglong Ready Ready Preview, Comment Jan 29, 2026 11:45am
qinglong-back Ready Ready Preview, Comment Jan 29, 2026 11:45am

Copilot AI and others added 2 commits January 29, 2026 11:28
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
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.

参数HITOKOTO设置不生效,获取HITOKOTO参数设置值时为字符串对比,但是设置时是布尔类型。

2 participants