Skip to content

Commit

Permalink
帮助文本微调
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice9Coffee committed Jun 28, 2020
1 parent d88764d commit f3ea2b4
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion hoshino/modules/botmanage/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hoshino.typing import CQEvent
from hoshino.util import DailyNumberLimiter

sv = Service('_feedback_', manage_priv=priv.SUPERUSER, visible=True, help_='[来杯咖啡] 后接反馈内容联系维护组')
sv = Service('_feedback_', manage_priv=priv.SUPERUSER, help_='[来杯咖啡] 后接反馈内容 联系维护组')

_max = 1
lmt = DailyNumberLimiter(_max)
Expand Down
16 changes: 6 additions & 10 deletions hoshino/modules/botmanage/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@
※※调教时请注意使用频率,您的滥用可能会导致bot账号被封禁
'''.strip()

# @sv.on_fullmatch(('help', 'manual', '帮助', '说明', '使用说明', '幫助', '說明', '使用說明', '菜单', '菜單'))
# async def send_help(bot, ev: CQEvent):
# await bot.send(ev, MANUAL)


def gen_bundle_manual(bundle_name, service_list, gid):
manual = [bundle_name]
service_list = sorted(service_list, key=lambda s: s.name)
for sv in service_list:
if sv.visible:
spit_line = '=' * max(0, 18 - len(sv.name))
manual.append(f"|{'o' if sv.check_enabled(gid) else 'x'}| {sv.name} {spit_line}")
manual.append(f"|{'' if sv.check_enabled(gid) else '×'}| {sv.name} {spit_line}")
if sv.help:
manual.append(sv.help)
return '\n'.join(manual)
Expand All @@ -56,8 +51,9 @@ def gen_bundle_manual(bundle_name, service_list, gid):
async def send_help(bot, ev: CQEvent):
bundle_name = ev.message.extract_plain_text().strip()
bundles = Service.get_bundles()
if bundle_name in bundles:
if not bundle_name:
await bot.send(ev, TOP_MANUAL)
elif bundle_name in bundles:
msg = gen_bundle_manual(bundle_name, bundles[bundle_name], ev.group_id)
else:
msg = TOP_MANUAL
await bot.send(ev, msg)
await bot.send(ev, msg)
# else: ignore
4 changes: 2 additions & 2 deletions hoshino/modules/botmanage/service_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from nonebot import permission as perm
from nonebot.argparse import ArgumentParser

from hoshino.service import Service, priv
from hoshino import Service, priv

PRIV_TIP = f'群主={priv.OWNER} 群管={priv.ADMIN} 群员={priv.NORMAL} bot维护组={priv.SUPERUSER}'

@on_command('lssv', aliases=('服务列表', '功能列表'), permission=perm.GROUP_ADMIN, only_to_me=False, shell_like=True)
async def lssv(session:CommandSession):
parser = ArgumentParser(session=session)
parser.add_argument('-a', '--all', action='store_true')
parser.add_argument('-h', '--hidden', action='store_true')
parser.add_argument('-H', '--hidden', action='store_true')
parser.add_argument('-g', '--group', type=int, default=0)
args = parser.parse_args(session.argv)

Expand Down
2 changes: 1 addition & 1 deletion hoshino/modules/flac/flac.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from hoshino.typing import CQEvent
from urllib.parse import quote

sv = Service('flac', help_='[搜无损] +日文关键词搜索')
sv = Service('flac', help_='[搜无损] +关键词搜索')

@sv.on_prefix('搜无损')
async def search_flac(bot, ev: CQEvent):
Expand Down
3 changes: 1 addition & 2 deletions hoshino/modules/groupmaster/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ async def say_hello(session):
await session.send('はい!私はいつも貴方の側にいますよ!')


sv = Service('chat', manage_priv=priv.SUPERUSER, visible=False)

sv = Service('chat', visible=False)

@sv.on_fullmatch(('沙雕机器人', '沙雕機器人'))
async def say_sorry(bot, ev):
Expand Down
4 changes: 2 additions & 2 deletions hoshino/modules/groupmaster/group_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from hoshino import Service
from hoshino.typing import NoticeSession

sv1 = Service('group-leave-notice')
sv1 = Service('group-leave-notice', help_='退群通知')

@sv1.on_notice('group_decrease.leave')
async def leave_notice(session: NoticeSession):
await session.send(f"{session.ctx['user_id']}退群了。")


sv2 = Service('group-welcome')
sv2 = Service('group-welcome', help_='入群欢迎')

@sv2.on_notice('group_increase')
async def increace_welcome(session: NoticeSession):
Expand Down
2 changes: 1 addition & 1 deletion hoshino/modules/groupmaster/random_repeater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from hoshino import Service
from hoshino.typing import CQEvent, CQHttpError

sv = Service('random-repeater', visible=False)
sv = Service('random-repeater', help_='随机复读机')

PROB_A = 1.4
group_stat = {} # group_id: (last_msg, is_repeated, p)
Expand Down
2 changes: 1 addition & 1 deletion hoshino/modules/groupmaster/sleeping_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from hoshino import Service, priv, util
from hoshino.typing import CQEvent

sv = Service('sleeping-set', visible=False, help_='''
sv = Service('sleeping-set', help_='''
[精致睡眠] 8小时精致睡眠(bot需具有群管理权限)
[给我来一份精致昏睡下午茶套餐] 叫一杯先辈特调红茶(bot需具有群管理权限)
'''.strip())
Expand Down
1 change: 1 addition & 0 deletions hoshino/modules/pcrclanbattle/clanbattlev3/cmdv3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
4 changes: 2 additions & 2 deletions hoshino/modules/priconne/arena_reminder.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from hoshino.service import Service

svtw = Service('pcr-arena-reminder-tw', enable_on_default=False, help_='背刺时间提醒(台B)', bundle='pcr订阅')
svjp = Service('pcr-arena-reminder-jp', enable_on_default=False, help_='背刺时间提醒(日)', bundle='pcr订阅')
svtw = Service('pcr-arena-reminder-tw', enable_on_default=False, help_='背刺时间提醒(台B)', bundle='pcr订阅')
svjp = Service('pcr-arena-reminder-jp', enable_on_default=False, help_='背刺时间提醒(日)', bundle='pcr订阅')
msg = '骑士君、准备好背刺了吗?'

@svtw.scheduled_job('cron', hour='14', minute='45')
Expand Down
2 changes: 1 addition & 1 deletion hoshino/modules/priconne/comic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from hoshino.typing import *

sv_help = '''
官方四格漫画更新(日文)
官方四格漫画更新(日文)
[官漫132] 阅览指定话
'''.strip()
sv = Service('pcr-comic', help_=sv_help, bundle='pcr订阅')
Expand Down
11 changes: 5 additions & 6 deletions hoshino/modules/priconne/gacha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
[星乃来发单抽] 转蛋模拟
[星乃来一井] 4w5钻!
[查看卡池] 模拟卡池&出率
[切换卡池] 更换模拟卡池
'''.strip()
sv = Service('gacha', help_=sv_help, bundle='pcr娱乐')
jewel_limit = DailyNumberLimiter(6000)
tenjo_limit = DailyNumberLimiter(1)

JEWEL_EXCEED_NOTICE = f'您今天已经抽过{jewel_limit.max}钻了,欢迎明早5点后再来!'
TENJO_EXCEED_NOTICE = f'您今天已经抽过{tenjo_limit.max}张天井券了,欢迎明早5点后再来!'
SWITCH_POOL_TIP = ''
POOL = ('MIX', 'JP', 'TW', 'BL')
DEFAULT_POOL = POOL[0]

Expand Down Expand Up @@ -62,10 +62,10 @@ async def gacha_info(bot, ev: CQEvent):
up_chara = map(lambda x: str(
chara.fromname(x, star=3).icon.cqcode) + x, up_chara)
up_chara = '\n'.join(up_chara)
await bot.send(ev, f"本期卡池主打的角色:\n{up_chara}\nUP角色合计={(gacha.up_prob/10):.1f}% 3★出率={(gacha.s3_prob)/10:.1f}%\n{SWITCH_POOL_TIP}")
await bot.send(ev, f"本期卡池主打的角色:\n{up_chara}\nUP角色合计={(gacha.up_prob/10):.1f}% 3★出率={(gacha.s3_prob)/10:.1f}%")


POOL_NAME_TIP = '请选择以下卡池\n> 选择卡池 jp\n> 选择卡池 tw\n> 选择卡池 bilibili\n> 选择卡池 mix'
POOL_NAME_TIP = '请选择以下卡池\n> 切换卡池jp\n> 切换卡池tw\n> 切换卡池b\n> 切换卡池mix'
@sv.on_prefix(('切换卡池', '选择卡池', '切換卡池', '選擇卡池'))
async def set_pool(bot, ev: CQEvent):
if not priv.check_priv(ev, priv.ADMIN):
Expand Down Expand Up @@ -118,7 +118,7 @@ async def gacha_1(bot, ev: CQEvent):
res = f'{chara.icon.cqcode} {res}'

await silence(ev, silence_time)
await bot.send(ev, f'素敵な仲間が増えますよ!\n{res}\n{SWITCH_POOL_TIP}', at_sender=True)
await bot.send(ev, f'素敵な仲間が増えますよ!\n{res}', at_sender=True)


@sv.on_prefix(gacha_10_aliases, only_to_me=True)
Expand Down Expand Up @@ -151,7 +151,7 @@ async def gacha_10(bot, ev: CQEvent):

if hiishi >= SUPER_LUCKY_LINE:
await bot.send(ev, '恭喜海豹!おめでとうございます!')
await bot.send(ev, f'素敵な仲間が増えますよ!\n{res}\n{SWITCH_POOL_TIP}', at_sender=True)
await bot.send(ev, f'素敵な仲間が増えますよ!\n{res}\n', at_sender=True)
await silence(ev, silence_time)


Expand Down Expand Up @@ -213,7 +213,6 @@ async def gacha_300(bot, ev: CQEvent):
msg.append("抽井母五一气呵成!多出30等专武~")
elif up >= 4:
msg.append("记忆碎片一大堆!您是托吧?")
msg.append(SWITCH_POOL_TIP)

await bot.send(ev, '\n'.join(msg), at_sender=True)
silence_time = (100*up + 50*(up+s3) + 10*s2 + s1) * 1
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ TwitterAPI>=2.5.10
matplotlib>=3.2.0
numpy>=1.18.0
beautifulsoup4>=4.9.0
pygtrie == 2.*
tinydb == 4.*
pygtrie>=2.0
tinydb>=4.0
aiohttp>=3.6

0 comments on commit f3ea2b4

Please sign in to comment.