Exemplo n.º 1
0
求签, 求运势, 包括且不限于抽卡、吃饭、睡懒觉、DD
每个人每天求同一个东西的结果是一样的啦!
不要不信邪重新抽啦!

**Permission**
Command & Lv.10

**Usage**
/求签 [所求之事]
/DD老黄历'''

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__)

# 注册事件响应器
Maybe = CommandGroup('maybe', rule=has_command_permission() & permission_level(level=10),
                     permission=GROUP, priority=10, block=True)

luck = Maybe.command('luck', aliases={'求签'})


# 修改默认参数处理
@luck.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await luck.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await luck.finish('操作已取消')
Exemplo n.º 2
0
    group_id = event.group_id
    group = DBGroup(group_id=group_id)
    res = group.mailbox_clear()

    if res.success():
        logger.info(f'Group:{event.group_id}/User:{event.user_id} 清空绑定邮箱成功')
        await admin_mail_bind.finish('Success! 已清空本群组的绑定邮箱')
    else:
        logger.info(
            f'Group:{event.group_id}/User:{event.user_id} 清空绑定邮箱失败, error: {res.info}'
        )
        await admin_mail_bind.finish('清空本群组的绑定邮箱失败QAQ, 请检联系管理员处理')


# 注册事件响应器
OmegaEmail_group = MatcherGroup(rule=has_command_permission()
                                & has_auth_node(__plugin_raw_name__, 'basic'),
                                permission=GROUP,
                                priority=20,
                                block=True)

mail_receive = OmegaEmail_group.on_command('收邮件')


@mail_receive.handle()
async def handle_first_receive(bot: Bot, event: GroupMessageEvent,
                               state: T_State):
    args = str(event.get_plaintext()).strip().split()
    if args:
        await mail_receive.finish('该命令不支持参数QAQ')
Exemplo n.º 3
0
# 声明本插件可配置的权限节点
__plugin_auth_node__ = [PluginCoolDown.skip_auth_node, 'setu', 'moepic']

# 声明本插件的冷却时间配置
__plugin_cool_down__ = [
    PluginCoolDown(__plugin_raw_name__, 'user', 10),
    PluginCoolDown(__plugin_raw_name__, 'group', 2)
]

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__, __plugin_auth_node__,
            __plugin_cool_down__)

# 注册事件响应器
setu = on_command('来点涩图',
                  rule=has_command_permission()
                  & has_level_or_node(50, __plugin_raw_name__, 'setu'),
                  permission=GROUP,
                  priority=20,
                  block=True)


@setu.handle()
async def handle_first_receive(bot: Bot, event: GroupMessageEvent,
                               state: T_State):
    args = set(str(event.get_plaintext()).strip().split())
    # 处理r18
    state['nsfw_tag'] = 1
    for tag in args.copy():
        if tag in ['r18', 'R18', 'r-18', 'R-18']:
            args.remove(tag)
Exemplo n.º 4
0
# 声明本插件可配置的权限节点
__plugin_auth_node__ = [
    PluginCoolDown.skip_auth_node
]

# 声明本插件的冷却时间配置
__plugin_cool_down__ = [
    PluginCoolDown(__plugin_raw_name__, 'user', 1)
]

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__, __plugin_auth_node__, __plugin_cool_down__)

# 注册事件响应器
Draw = CommandGroup('draw', rule=has_command_permission() & permission_level(level=10),
                    permission=GROUP, priority=10, block=True)

deck = Draw.command('deck', aliases={'抽卡'})


# 修改默认参数处理
@deck.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await deck.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await deck.finish('操作已取消')
Exemplo n.º 5
0
__plugin_usage__ = r'''【能不能好好说话?】
拼音首字母缩写释义

**Permission**
Command & Lv.30

**Usage**
/好好说话 [缩写]'''


# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__)


# 注册事件响应器
nbnhhsh = on_command('好好说话', rule=has_command_permission() & permission_level(level=30), aliases={'hhsh', 'nbnhhsh'},
                     permission=GROUP, priority=20, block=True)


# 修改默认参数处理
@nbnhhsh.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await nbnhhsh.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await nbnhhsh.finish('操作已取消')


@nbnhhsh.handle()
Exemplo n.º 6
0
from nonebot import MatcherGroup, logger
from nonebot.typing import T_State
from nonebot.rule import to_me
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.adapters.cqhttp.message import MessageSegment
from nonebot.adapters.cqhttp.event import GroupMessageEvent
from nonebot.adapters.cqhttp.permission import GROUP
from omega_miya.utils.Omega_plugin_utils import has_command_permission, permission_level
from .resources import MiyaVoice
"""
miya按钮bot实现版本
测试中
"""

button = MatcherGroup(type='message',
                      rule=to_me() & has_command_permission()
                      & permission_level(level=10),
                      permission=GROUP,
                      priority=100,
                      block=False)

miya_button = button.on_endswith(msg='喵一个')


@miya_button.handle()
async def miya_button(bot: Bot, event: GroupMessageEvent, state: T_State):
    arg = str(event.get_plaintext()).strip().lower()
    voice = re.sub('喵一个', '', arg)
    voice_file = MiyaVoice().get_voice_filepath(voice=voice)
    if not os.path.exists(voice_file):
        await bot.send(event=event, message='喵?')
Exemplo n.º 7
0
__plugin_usage__ = r'''【Roll & 抽奖】
一个整合了各种roll机制的插件
更多功能待加入

**Permission**
Command & Lv.10

**Usage**
/roll <x>d<y>
/抽奖 <人数>'''

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__)

roll = on_command('roll',
                  rule=has_command_permission() & permission_level(level=10),
                  aliases={'Roll'},
                  permission=GROUP,
                  priority=10,
                  block=True)


# 修改默认参数处理
@roll.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await roll.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await roll.finish('操作已取消')
Exemplo n.º 8
0
**Permission**
Command & Lv.20

**Usage**
**GroupAdmin and SuperUser Only**
/B站动态 订阅 [UID]
/B站动态 取消订阅 [UID]
/B站动态 清空订阅
/B站动态 订阅列表'''

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__)


# 注册事件响应器
bilibili_dynamic = on_command('B站动态', rule=has_command_permission() & permission_level(level=20), aliases={'b站动态'},
                              permission=GROUP_ADMIN | GROUP_OWNER | SUPERUSER, priority=20, block=True)


# 修改默认参数处理
@bilibili_dynamic.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await bilibili_dynamic.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await bilibili_dynamic.finish('操作已取消')


@bilibili_dynamic.handle()
Exemplo n.º 9
0
**Usage**
/nh search [tag]
/nh download [id]'''

# 声明本插件可配置的权限节点
__plugin_auth_node__ = [
    'basic'
]

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__, __plugin_auth_node__)


# 注册事件响应器
nhentai = on_command(
    'nh', rule=has_command_permission() & permission_level(level=50) & has_auth_node(__plugin_raw_name__, 'basic'),
    aliases={'NH'}, permission=GROUP, priority=20, block=True)


# 修改默认参数处理
@nhentai.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await nhentai.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await nhentai.finish('操作已取消')


@nhentai.handle()
Exemplo n.º 10
0
**Usage**
/技能 清单
/技能 我会的
/技能 设置 [技能名称] [技能等级]
/技能 删除 [技能名称]
/技能 清空

**SuperUser Only**
/Skill add [SkillName] [SkillDescription]
/Skill del [SkillName]'''

# Init plugin export
init_export(export(), __plugin_name__, __plugin_usage__)

# 注册事件响应器
skill_admin = on_command('Skill', rule=has_command_permission(), aliases={'skill'},
                         permission=SUPERUSER, priority=10, block=True)


# 修改默认参数处理
@skill_admin.args_parser
async def parse(bot: Bot, event: GroupMessageEvent, state: T_State):
    args = str(event.get_plaintext()).strip().lower().split()
    if not args:
        await skill_admin.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:')
    state[state["_current_key"]] = args[0]
    if state[state["_current_key"]] == '取消':
        await skill_admin.finish('操作已取消')


@skill_admin.handle()