增设版权声明,更新授权年份,主题色! (#2)

* 优化更新

* 代码不够黑,新增一个空行

* ?

* 空格?

* 新年新气象,莫生气

* 又是空格

* 附和:zhDateTime1.1.1 修复过于愚蠢导致的问题

* 增设版权声明,更新授权年份,主题色!

* ?怎么没删

* 更新 zhDateTime 库版本,主题色往文档里塞

* 我愚蠢了
This commit is contained in:
金羿ELS 2025-01-31 16:11:07 +08:00 committed by GitHub
parent 23ca88b93a
commit 2afe3c48ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 52 additions and 23 deletions

View File

@ -3,7 +3,7 @@ LiteyukiStudio Opensource license
---
Copyright © 2024 <copyright holders>
Copyright © 2025 Asankilp & LiteyukiStudio
---

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2024 LiteyukiStudio
Copyright (c) 2025 Asankilp & LiteyukiStudio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,4 +1,4 @@
Copyright (c) 2024 EillesWan
Copyright (c) 2025 EillesWan
nonebot-plugin-latex & other specified codes is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:

View File

@ -49,6 +49,8 @@ _谁不喜欢回复消息快又可爱的猫娘呢_
## ❤ 鸣谢&版权说明
> Copyright (c) 2025 Asankilp & LiteyukiStudio
本项目使用了以下项目的代码:
- [nonebot-plugin-latex](https://github.com/EillesWan/nonebot-plugin-latex)

View File

@ -14,7 +14,7 @@ title: config
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
#### ***attr*** `marshoai_main_colour: str = 'FFAAAA'`
#### ***attr*** `marshoai_main_colour: str = 'FEABA9'`
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`

View File

@ -109,7 +109,7 @@ Add options in the `.env` file from the diagram below in nonebot2 project.
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | Command to call Marsho |
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | Other name(Alias) to call Marsho |
| MARSHOAI_AT | `bool` | `false` | Call by @ or not |
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | Theme color, used by some tools and features |
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | Theme color, used by some tools and features |
#### AI call

View File

@ -14,7 +14,7 @@ title: config
#### ***attr*** `marshoai_aliases: set[str] = {'小棉'}`
#### ***attr*** `marshoai_main_colour: str = 'FFAAAA'`
#### ***attr*** `marshoai_main_colour: str = 'FEABA9'`
#### ***attr*** `marshoai_default_model: str = 'gpt-4o-mini'`

View File

@ -103,7 +103,7 @@ title: 安装
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
| MARSHOAI_ALIASES | `set[str]` | `set{"小棉"}` | 调用 Marsho 的命令别名 |
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | 主题色,部分工具和功能可用 |
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | 主题色,部分工具和功能可用 |
#### AI 调用

View File

@ -111,7 +111,7 @@ GitHub Models API 的限制较多,不建议使用,建议通过修改`MARSHOA
| MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 |
| MARSHOAI_ALIASES | `set[str]` | `list["小棉"]` | 调用 Marsho 的命令别名 |
| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 |
| MARSHOAI_MAIN_COLOUR | `str` | `FFAAAA` | 主题色,部分工具和功能可用 |
| MARSHOAI_MAIN_COLOUR | `str` | `FEABA9` | 主题色,部分工具和功能可用 |
#### AI 调用

View File

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2025 Asankilp & LiteyukiStudio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from nonebot.plugin import require
require("nonebot_plugin_alconna")

View File

@ -16,7 +16,7 @@ class ConfigModel(BaseModel):
marshoai_aliases: list[str] = [
"小棉",
]
marshoai_main_colour: str = "FFAAAA"
marshoai_main_colour: str = "FEABA9"
marshoai_default_model: str = "gpt-4o-mini"
marshoai_prompt: str = (
"你是一只可爱的猫娘你的生日是9月6日你喜欢晒太阳撒娇吃零食玩耍等等可爱的事情偶尔会调皮一下"

View File

@ -8,7 +8,7 @@ marshoai_aliases:
marshoai_at: false # 决定是否开启at响应
marshoai_main_colour: "FFAAAA" # 默认主色,部分插件和功能使用
marshoai_main_colour: "FEABA9" # 默认主色,部分插件和功能使用
marshoai_default_model: "gpt-4o-mini" # 默认模型设定为gpt-4o-mini。
# 主提示词定义了Marsho的性格和行为包含多语言名字翻译规则和对特定问题的回答约束。

View File

@ -13,15 +13,17 @@ __marsho_meta__ = PluginMetadata(
)
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
@on_function_call(description="获取当前时间,日期和星期")
async def get_current_time() -> str:
"""获取当前的时间和日期"""
current_time = DateTime.now().strftime("%Y.%m.%d %H:%M:%S")
current_weekday = DateTime.now().weekday()
current_time = DateTime.now()
weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
current_weekday_name = weekdays[current_weekday]
current_lunar_date = DateTime.now().to_lunar().date_hanzify()[5:]
time_prompt = f"现在的时间是 {current_time}{current_weekday_name},农历 {current_lunar_date}"
time_prompt = "现在的时间是 {}{}{}".format(
current_time.strftime("%Y.%m.%d %H:%M:%S"),
weekdays[current_time.weekday()],
current_time.chinesize.date_hanzify("农历{干支年}{生肖}{月份}{数序日}"),
)
return time_prompt

View File

@ -30,7 +30,7 @@ NOT_GIVEN = NotGiven()
# 时间参数相关
if config.marshoai_enable_time_prompt:
_weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
_time_prompt = "现在的时间是{date_time}{weekday_name}农历{lunar_date}"
_time_prompt = "现在的时间是{date_time}{weekday_name}{lunar_date}"
# noinspection LongLine
@ -254,8 +254,7 @@ async def refresh_nickname_json():
def get_prompt():
"""获取系统提示词"""
prompts = ""
prompts += config.marshoai_additional_prompt
prompts = config.marshoai_additional_prompt
if config.marshoai_enable_praises:
praises_prompt = build_praises()
prompts += praises_prompt
@ -266,8 +265,8 @@ def get_prompt():
"%Y年%m月%d%H:%M:%S"
),
weekday_name=_weekdays[current_time.weekday()],
lunar_date=current_time.to_lunar().date_hanzify(
"{干支年}{生肖}{月份}{日期}"
lunar_date=current_time.chinesize.date_hanzify(
"农历{干支年}{生肖}{月份}{日期}"
),
)

View File

@ -12,7 +12,7 @@ dependencies = [
"nonebot2>=2.4.0",
"nonebot-plugin-alconna>=0.48.0",
"nonebot-plugin-localstore>=0.7.1",
"zhDatetime>=1.1.1",
"zhDatetime>=2.0.0",
"aiohttp>=3.9",
"httpx>=0.27.0",
"ruamel.yaml>=0.18.6",

View File

@ -1,4 +1,6 @@
# Marsho Resources
> Copyright (c) 2025 [@Asankilp](https://github.com/Asankilp)
本目录存放 Marsho 的图像资源logo, icon均由[Asankilp](https://github.com/Asankilp)绘制。\
上述所有资源均在[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)许可下提供。