mirror of
https://github.com/Refound-445/nonebot-plugin-nailongremove.git
synced 2025-11-04 21:22:43 +08:00
up
This commit is contained in:
parent
8bd63cf2c8
commit
13cccdfc31
@ -178,6 +178,10 @@ plugins = [
|
||||
|
||||
## 📝 更新日志
|
||||
|
||||
### 2.1.4
|
||||
|
||||
- 修复 `NAILONG_NEED_ADMIN` 配置不生效的 Bug
|
||||
|
||||
### 2.1.3
|
||||
|
||||
- 修复忽略群管与超级用户无效的 Bug
|
||||
|
||||
@ -9,7 +9,7 @@ require("nonebot_plugin_uninfo")
|
||||
from . import handler as handler
|
||||
from .config import Config
|
||||
|
||||
__version__ = "2.1.3"
|
||||
__version__ = "2.1.4"
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="自动撤回奶龙",
|
||||
description="一个基于图像分类模型的简单插件~",
|
||||
|
||||
@ -94,7 +94,7 @@ async def nailong_rule(
|
||||
)
|
||||
)
|
||||
and self_info.role
|
||||
and self_info.role.level >= 1,
|
||||
and self_info.role.level > 1,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@ -101,11 +101,12 @@ async def telegram(bot: BaseBot, ev: BaseEvent, seconds: int):
|
||||
if not (isinstance(bot, Bot) and isinstance(ev, GroupMessageEvent)):
|
||||
raise TypeError("Unsupported bot or event type")
|
||||
|
||||
should_not_mute = seconds < 30
|
||||
await bot.restrict_chat_member(
|
||||
chat_id=ev.chat.id,
|
||||
user_id=ev.from_.id,
|
||||
permissions=ChatPermissions(can_send_messages=seconds < 30),
|
||||
until_date=int(time()) + seconds,
|
||||
permissions=ChatPermissions(can_send_messages=should_not_mute),
|
||||
until_date=None if should_not_mute else int(time()) + seconds,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user