This commit is contained in:
student_2333 2024-10-30 22:18:54 +08:00
parent 8bd63cf2c8
commit 13cccdfc31
No known key found for this signature in database
GPG Key ID: 665F083BEC56F2A6
4 changed files with 9 additions and 4 deletions

View File

@ -178,6 +178,10 @@ plugins = [
## 📝 更新日志 ## 📝 更新日志
### 2.1.4
- 修复 `NAILONG_NEED_ADMIN` 配置不生效的 Bug
### 2.1.3 ### 2.1.3
- 修复忽略群管与超级用户无效的 Bug - 修复忽略群管与超级用户无效的 Bug

View File

@ -9,7 +9,7 @@ require("nonebot_plugin_uninfo")
from . import handler as handler from . import handler as handler
from .config import Config from .config import Config
__version__ = "2.1.3" __version__ = "2.1.4"
__plugin_meta__ = PluginMetadata( __plugin_meta__ = PluginMetadata(
name="自动撤回奶龙", name="自动撤回奶龙",
description="一个基于图像分类模型的简单插件~", description="一个基于图像分类模型的简单插件~",

View File

@ -94,7 +94,7 @@ async def nailong_rule(
) )
) )
and self_info.role and self_info.role
and self_info.role.level >= 1, and self_info.role.level > 1,
) )
) )
) )

View File

@ -101,11 +101,12 @@ async def telegram(bot: BaseBot, ev: BaseEvent, seconds: int):
if not (isinstance(bot, Bot) and isinstance(ev, GroupMessageEvent)): if not (isinstance(bot, Bot) and isinstance(ev, GroupMessageEvent)):
raise TypeError("Unsupported bot or event type") raise TypeError("Unsupported bot or event type")
should_not_mute = seconds < 30
await bot.restrict_chat_member( await bot.restrict_chat_member(
chat_id=ev.chat.id, chat_id=ev.chat.id,
user_id=ev.from_.id, user_id=ev.from_.id,
permissions=ChatPermissions(can_send_messages=seconds < 30), permissions=ChatPermissions(can_send_messages=should_not_mute),
until_date=int(time()) + seconds, until_date=None if should_not_mute else int(time()) + seconds,
) )