🎨 支持部分情况的前缀去除

This commit is contained in:
KimigaiiWuyi 2023-11-29 02:45:41 +08:00
parent b358fc374e
commit 3ea613fb97
2 changed files with 6 additions and 5 deletions

View File

@ -150,7 +150,7 @@ async def get_all_message(bot: Bot, ev: Event):
elif isinstance(ev, GroupAtMessageCreateEvent):
sp_bot_id = 'qqgroup'
user_type = 'group'
group_id = str(ev.group_id)
group_id = str(ev.group_openid)
msg_id = ev.id
sender = ev.author.dict()
elif isinstance(ev, C2CMessageCreateEvent):
@ -542,10 +542,11 @@ def convert_message(_msg: Any, message: List[Message], index: int):
_msg.data['text'] if 'text' in _msg.data else _msg.data['content']
)
if index == 0:
if index == 0 or index == 1:
for word in command_start:
if data.startswith(word):
data = data[len(word) :] # noqa:E203
_data = data.strip()
if _data.startswith(word):
data = _data[len(word) :] # noqa:E203
break
message.append(Message('text', data))
elif _msg.type == 'image':

View File

@ -23,7 +23,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "nonebot-plugin-genshinuid"
version = "4.4.2"
version = "4.4.3"
description = "支持OneBot(QQ)、OneBotV12、QQ频道、微信、KOOK开黑啦、Telegram电报、FeiShu飞书、DoDo、Villa米游社大别野、Discord的全功能NoneBot2原神插件"
authors = ["KimigaiiWuyi <444835641@qq.com>"]
license = "GPL-3.0-or-later"