#规范命名

This commit is contained in:
ShiXui 2022-10-05 13:06:55 +08:00
parent 7b0bf0a572
commit 19157be9f2
3 changed files with 5 additions and 4 deletions

View File

@ -201,5 +201,6 @@ async def handle_message(
await rankings.send(msg) await rankings.send(msg)
await asyncio.sleep(1) #让图片先发出来 await asyncio.sleep(1) #让图片先发出来
await rankings.finish(plugin_config.dialectlist_string_suffix_format.format(timeCost=time.time()-st-1)) if plugin_config.dialectlist_string_suffix_format:
await rankings.finish(plugin_config.dialectlist_string_suffix_format.format(timecost=time.time()-st-1))

View File

@ -6,8 +6,8 @@ from pydantic import BaseModel, Extra
class Config(BaseModel, extra=Extra.ignore): class Config(BaseModel, extra=Extra.ignore):
timezone: Optional[str] timezone: Optional[str]
dialectlist_string_format: str = '{index}名:\n{nickname},{chatDataNum}条消息\n' #消息格式 dialectlist_string_format: str = '{index}名:\n{nickname},{chatdatanum}条消息\n' #消息格式
dialectlist_string_suffix_format: str = '你们的职业是水群吗————MYX\n计算花费时间:{timeCost}' #消息后缀格式 dialectlist_string_suffix_format: Optional[str] = '你们的职业是水群吗————MYX\n计算花费时间:{timecost}' #消息后缀格式
dialectlist_get_num:int = 10 #获取人数数量 dialectlist_get_num:int = 10 #获取人数数量
dialectlist_visualization:bool = True #是否可视化 dialectlist_visualization:bool = True #是否可视化
dialectlist_visualization_type:Literal['饼图','圆环图','柱状图'] = '圆环图' #可视化方案 dialectlist_visualization_type:Literal['饼图','圆环图','柱状图'] = '圆环图' #可视化方案

View File

@ -183,7 +183,7 @@ async def msg_list2msg(
for i in range(got_num): for i in range(got_num):
index = i+1 index = i+1
nickname,chatdatanum = ranking[i] nickname,chatdatanum = ranking[i]
str_example = plugin_config.dialectlist_string_format.format(index=index,nickname=nickname,chatDataNum=chatdatanum) str_example = plugin_config.dialectlist_string_format.format(index=index,nickname=nickname,chatdatanum=chatdatanum)
out = out + str_example out = out + str_example
logger.debug(out) logger.debug(out)