mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-10 06:10:01 +08:00
feat✨: 禁言检测
This commit is contained in:
@@ -50,6 +50,23 @@ class UserData(BaseModel):
|
||||
|
||||
class PlatformUtils:
|
||||
|
||||
@classmethod
|
||||
async def ban_user(cls, bot: Bot, user_id: str, group_id: str, duration: int):
|
||||
"""禁言
|
||||
|
||||
参数:
|
||||
bot: Bot
|
||||
user_id: 用户id
|
||||
group_id: 群组id
|
||||
duration: 禁言时长(分钟)
|
||||
"""
|
||||
if isinstance(bot, v11Bot):
|
||||
await bot.set_group_ban(
|
||||
group_id=int(group_id),
|
||||
user_id=int(user_id),
|
||||
duration=duration * 60,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
async def send_superuser(
|
||||
cls,
|
||||
|
||||
Reference in New Issue
Block a user