def cb_prefix(cmds): if isinstance(cmds, str): cmds = (cmds, ) return join_iterable(('!', '!'), cmds)
img = [] img_name = [] def load_images(): global img, img_name, img_dir img = os.listdir(img_dir) img_name = [''.join(s.split('.')[:-1]) for s in img] load_images() sv = Service('meme-generator') _meme = ['表情包', '表情'] show_meme_prefix = join_iterable(_meme, ['列表']) + join_iterable( ['查看'], _meme) + ('meme-list', ) @sv.on_fullmatch(show_meme_prefix) async def show_memes(bot: KokkoroBot, event: EventInterface): msg = "当前表情有:" for meme in img_name: msg += "\n" + meme await bot.kkr_send(event, msg, at_sender=True) _refresh = ['刷新', '更新'] refresh_meme_prefix = join_iterable(_meme, _refresh) + join_iterable( _refresh, _meme) + ('meme-refresh', )
===其他查询关键词=== {OTHER_KEYWORDS} ※日台服速查请输入【pcr速查】''' @sv.on_fullmatch(('pcr速查', 'pcr图书馆', '图书馆', 'pcr-sites')) async def pcr_sites(bot, ev: EventInterface): await bot.kkr_send(ev, PCR_SITES, at_sender=True) @sv.on_fullmatch(('bcr速查', 'bcr攻略', 'bcr-sites')) async def bcr_sites(bot, ev: EventInterface): await bot.kkr_send(ev, BCR_SITES, at_sender=True) YUKARI_SHEET_ALIAS = util.join_iterable( ('黄骑', '酒鬼', '黃騎'), ('充电', '充电表', '充能', '充能表')) + ('yukari-sheet', ) YUKARI_SHEET = f''' ※大圈是1动充电对象 PvP测试 ※黄骑四号位例外较多 ※对面羊驼或中后卫坦 有可能歪 ※我方羊驼算一号位 ※图片搬运自漪夢奈特''' @sv.on_fullmatch(YUKARI_SHEET_ALIAS) async def yukari_sheet(bot, ev): await bot.kkr_send(ev, R.img('priconne/quick/黄骑充电.jpg')) await bot.kkr_send(ev, YUKARI_SHEET, at_sender=True) NORMAL_MAP_PREFIX = '刷图'
[明日方舟帮助]查看明日方舟相关功能 [通用功能]查看通用功能 [微博帮助]查看微博功能 =====管理限定功能===== [lssv] 查看功能模块的开关状态 [enable <服务名>] 开启指定服务 [disable <服务名>] 关闭指定服务 ==================== {HELP_BOTTOM} '''.strip() _pcr = ['公主连结', '公主链接', '公主连接', 'pcr', 'bcr'] _help = ['帮助', 'help'] @sv.on_fullmatch(join_iterable(_pcr, _help) + ('pcr-help', )) async def pcr_help(bot, ev: EventInterface): await bot.kkr_send(ev, PRC_HELP) _ark = ['明日方舟', '舟游', 'arknights'] @sv.on_fullmatch(tuple([''.join(l) for l in itertools.product(_ark, _help)])) async def ark_help(bot, ev: EventInterface): await bot.kkr_send(ev, ARKNIGHTS_HELP) # _weibo=['wb', '微博', 'weibo'] # @sv.on_fullmatch(tuple([''.join(l) for l in itertools.product(_weibo, _help)])) # async def weibo_help(bot, ev: EventInterface):
async def new_year_burst(bot: KokkoroBot, ev: EventInterface): cmd = ev.get_param().plain_text if cmd in util.join_iterable(_ue_sorry, _image_suffix) or random.random() < 0.02: await bot.kkr_send(ev, R.img('ue_sorry.jpg'))
async def new_year_burst(bot: KokkoroBot, ev: EventInterface): cmd = ev.get_param().plain_text if cmd in util.join_iterable(_ch, _image_suffix) or random.random() < 0.02: await bot.kkr_send(ev, R.img('newyearburst.gif')) await bot.kkr_send(ev, nyb_player)
async def africa(bot: KokkoroBot, ev: EventInterface): cmd = ev.get_param().plain_text if cmd in util.join_iterable(_africa, _image_suffix) or random.random() < 0.05: await bot.kkr_send(ev, R.img('非洲人.png'))
def dump_pool_config(): with open(_pool_config_file, 'w', encoding='utf8') as f: json.dump(_group_pool, f, ensure_ascii=False) _gacha_10_aliases = ('抽十连', '十连', '十连!', '十连抽', '来个十连', '来发十连', '来次十连', '抽个十连', '抽发十连', '抽次十连', '十连扭蛋', '扭蛋十连', '10连', '10连!', '10连抽', '来个10连', '来发10连', '来次10连', '抽个10连', '抽发10连', '抽次10连', '10连扭蛋', '扭蛋10连', '十連', '十連!', '十連抽', '來個十連', '來發十連', '來次十連', '抽個十連', '抽發十連', '抽次十連', '十連轉蛋', '轉蛋十連', '10連', '10連!', '10連抽', '來個10連', '來發10連', '來次10連', '抽個10連', '抽發10連', '抽次10連', '10連轉蛋', '轉蛋10連') en_10 = ('gacha-10', 'gacha10', '10gacha') gacha_10_aliases = join_iterable(("/"), _gacha_10_aliases) + en_10 en_1 = ('gacha-1', 'gacha1', '1gacha') _gacha_1_aliases = ('单抽', '单抽!', '来发单抽', '来个单抽', '来次单抽', '扭蛋单抽', '单抽扭蛋', '單抽', '單抽!', '來發單抽', '來個單抽', '來次單抽', '轉蛋單抽', '單抽轉蛋') gacha_1_aliases = join_iterable(("/"), _gacha_1_aliases) + en_1 en_300 = ('gacha-300', 'gacha300', '300gacha', 'tenjo') _gacha_300_aliases = ('井', '抽一井', '来一井', '来发井', '來一井', '抽发井', '天井扭蛋', '扭蛋天井', '天井轉蛋', '轉蛋天井') gacha_300_aliases = join_iterable(("/"), _gacha_300_aliases) + en_300 @sv.on_fullmatch( ('卡池资讯', '查看卡池', '看看卡池', '康康卡池', '卡池資訊', '看看up', '看看UP', 'gacha-info')) async def gacha_info(bot: KokkoroBot, ev: EventInterface):