mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-03 10:40:02 +08:00
feat✨: add black_word
This commit is contained in:
@@ -31,7 +31,7 @@ __plugin_meta__ = PluginMetadata(
|
||||
usage="""
|
||||
普通管理员
|
||||
格式:
|
||||
ban [At用户] [时长]
|
||||
ban [At用户] [时长(分钟)]
|
||||
|
||||
示例:
|
||||
ban @用户 : 永久拉黑用户
|
||||
|
||||
@@ -40,4 +40,4 @@ Config.add_plugin_config(
|
||||
type=int,
|
||||
)
|
||||
|
||||
# nonebot.load_plugins(str(Path(__file__).parent.resolve()))
|
||||
nonebot.load_plugins(str(Path(__file__).parent.resolve()))
|
||||
|
||||
@@ -38,10 +38,8 @@ async def _(
|
||||
ban_result = Config.get_config("hook", "BAN_RESULT")
|
||||
if user_id in bot.config.superusers:
|
||||
return
|
||||
if await BanConsole.is_ban(user_id) or await BanConsole.is_ban(
|
||||
user_id, group_id
|
||||
):
|
||||
time = await BanConsole.check_ban_time(user_id)
|
||||
if await BanConsole.is_ban(user_id, group_id):
|
||||
time = await BanConsole.check_ban_time(user_id, group_id)
|
||||
if time == -1:
|
||||
time_str = "∞"
|
||||
else:
|
||||
@@ -49,7 +47,13 @@ async def _(
|
||||
if time < 60:
|
||||
time_str = str(time) + " 秒"
|
||||
else:
|
||||
time_str = str(int(time / 60)) + " 分钟"
|
||||
minute = int(time / 60)
|
||||
if minute > 60:
|
||||
hours = int(minute / 60)
|
||||
minute = minute % 60
|
||||
time_str = f"{hours} 小时 {minute}分钟"
|
||||
else:
|
||||
time_str = f"{minute} 分钟"
|
||||
if ban_result and _flmt.check(user_id):
|
||||
_flmt.start_cd(user_id)
|
||||
await MessageFactory(
|
||||
|
||||
@@ -6,11 +6,7 @@ from nonebot.adapters.kaiheila import Bot as KaiheilaBot
|
||||
from nonebot.adapters.onebot.v11 import Bot as v11Bot
|
||||
from nonebot.adapters.onebot.v12 import Bot as v12Bot
|
||||
from nonebot_plugin_alconna import UniMsg
|
||||
from nonebot_plugin_saa import (
|
||||
Image,
|
||||
MessageFactory,
|
||||
Text,
|
||||
)
|
||||
from nonebot_plugin_saa import Image, MessageFactory, Text
|
||||
from nonebot_plugin_session import EventSession
|
||||
|
||||
from zhenxun.models.group_console import GroupConsole
|
||||
@@ -49,7 +45,7 @@ class BroadcastManage:
|
||||
group.group_id, "broadcast", group.channel_id
|
||||
):
|
||||
target = PlatformManage.get_target(
|
||||
bot, group.group_id, group.channel_id
|
||||
bot, None, group.group_id, group.channel_id
|
||||
)
|
||||
if target:
|
||||
await MessageFactory(message_list).send_to(target, bot)
|
||||
|
||||
Reference in New Issue
Block a user