mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-12-16 13:40:53 +08:00
✨ 删除群聊学习
中和语音合成有关的内容
This commit is contained in:
parent
607ac17262
commit
b40535e45f
@ -166,6 +166,7 @@ async def _(event: MessageEvent):
|
|||||||
msg = f'{NICKNAME}明明没有在学你们说话!'
|
msg = f'{NICKNAME}明明没有在学你们说话!'
|
||||||
else:
|
else:
|
||||||
msg = random.choice([f'你管得着{NICKNAME}吗!', f'你可没有权限要求{NICKNAME}!'])
|
msg = random.choice([f'你管得着{NICKNAME}吗!', f'你可没有权限要求{NICKNAME}!'])
|
||||||
|
config_manager.save()
|
||||||
await set_enable.finish(msg)
|
await set_enable.finish(msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ class ChatConfig(BaseModel):
|
|||||||
repeat_threshold: int = Field(3, alias='复读阈值')
|
repeat_threshold: int = Field(3, alias='复读阈值')
|
||||||
speak_threshold: int = Field(5, alias='主动发言阈值')
|
speak_threshold: int = Field(5, alias='主动发言阈值')
|
||||||
split_probability: float = Field(0.5, alias='按逗号分割回复概率')
|
split_probability: float = Field(0.5, alias='按逗号分割回复概率')
|
||||||
voice_probability: float = Field(0.1, alias='以语音回复概率')
|
|
||||||
speak_continuously_probability: float = Field(0.5, alias='连续主动发言概率')
|
speak_continuously_probability: float = Field(0.5, alias='连续主动发言概率')
|
||||||
speak_poke_probability: float = Field(0.5, alias='主动发言附带戳一戳概率')
|
speak_poke_probability: float = Field(0.5, alias='主动发言附带戳一戳概率')
|
||||||
speak_continuously_max_len: int = Field(3, alias='最大连续说话句数')
|
speak_continuously_max_len: int = Field(3, alias='最大连续说话句数')
|
||||||
|
@ -166,9 +166,6 @@ class LearningChat:
|
|||||||
'reply': item,
|
'reply': item,
|
||||||
'reply_keywords': answer_keywords,
|
'reply_keywords': answer_keywords,
|
||||||
})
|
})
|
||||||
if '[CQ:' not in item and len(item) > 1 and random.random() < config.voice_probability:
|
|
||||||
yield MessageSegment.record(f'http://233366.proxy.nscc-gz.cn:8888/?text={item}&speaker=派蒙')
|
|
||||||
else:
|
|
||||||
yield item
|
yield item
|
||||||
|
|
||||||
with LearningChat._reply_lock:
|
with LearningChat._reply_lock:
|
||||||
|
@ -136,7 +136,7 @@ async def draw_statistics_img(data: Dict[str, Any]):
|
|||||||
}
|
}
|
||||||
avatar = await get_group_avatar(data['群号'])
|
avatar = await get_group_avatar(data['群号'])
|
||||||
await img.paste(avatar, (38, 47))
|
await img.paste(avatar, (38, 47))
|
||||||
await img.text(data['群名称'], 162, 63, fm.get('hywh', 48), '#040404')
|
await img.text(data['群名称'], 162, 58, fm.get('hywh', 48), '#040404')
|
||||||
await img.text(data['群号'], 165, 116, fm.get('hywh', 36), '#040404')
|
await img.text(data['群号'], 165, 116, fm.get('hywh', 36), '#040404')
|
||||||
await img.text(f'CREATED BY LITTLEPAIMON AT {datetime.datetime.now().strftime("%m-%d %H:%M")}',
|
await img.text(f'CREATED BY LITTLEPAIMON AT {datetime.datetime.now().strftime("%m-%d %H:%M")}',
|
||||||
1033, 195, fm.get('bahnschrift_regular.ttf', 30), '#8c4c2e', 'right')
|
1033, 195, fm.get('bahnschrift_regular.ttf', 30), '#8c4c2e', 'right')
|
||||||
@ -202,6 +202,7 @@ async def draw_statistics_img(data: Dict[str, Any]):
|
|||||||
tag = await load_image(RESOURCE_BASE_PATH / 'general' / 'tag.png')
|
tag = await load_image(RESOURCE_BASE_PATH / 'general' / 'tag.png')
|
||||||
# 角色出场率
|
# 角色出场率
|
||||||
for i in range(4):
|
for i in range(4):
|
||||||
|
try:
|
||||||
icon, rarity, count = data['11层上半'][i][0].split('-')[0], data['11层上半'][i][0].split('-')[1], data['11层上半'][i][1]
|
icon, rarity, count = data['11层上半'][i][0].split('-')[0], data['11层上半'][i][0].split('-')[1], data['11层上半'][i][1]
|
||||||
await img.paste(box[f'{rarity}bg'], (182 + i * 101, 867))
|
await img.paste(box[f'{rarity}bg'], (182 + i * 101, 867))
|
||||||
await img.paste(await load_image(RESOURCE_BASE_PATH / 'avatar' / f'{icon}.png', size=(95, 95)), (182 + i * 101, 867))
|
await img.paste(await load_image(RESOURCE_BASE_PATH / 'avatar' / f'{icon}.png', size=(95, 95)), (182 + i * 101, 867))
|
||||||
@ -226,6 +227,8 @@ async def draw_statistics_img(data: Dict[str, Any]):
|
|||||||
await img.paste(tag, (696 + i * 101, 1058))
|
await img.paste(tag, (696 + i * 101, 1058))
|
||||||
await img.text(str(count), (696 + i * 101, 737 + i * 101), 1059, fm.get('bahnschrift_regular.ttf', 19), 'white', 'center')
|
await img.text(str(count), (696 + i * 101, 737 + i * 101), 1059, fm.get('bahnschrift_regular.ttf', 19), 'white', 'center')
|
||||||
i += 1
|
i += 1
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
return MessageBuild.Image(img, mode='RGB', quality=80)
|
return MessageBuild.Image(img, mode='RGB', quality=80)
|
||||||
|
|
||||||
|
@ -22,3 +22,7 @@ class logger:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def warning(command: str, info: str = '', action: str = ''):
|
def warning(command: str, info: str = '', action: str = ''):
|
||||||
nb_logger.opt(colors=True).warning(f'<u><y>[{command}]</y></u>{info}<m>{action}</m>')
|
nb_logger.opt(colors=True).warning(f'<u><y>[{command}]</y></u>{info}<m>{action}</m>')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def debug(command: str, info: str):
|
||||||
|
nb_logger.opt(colors=True).debug(f'<u><y>[{command}]</y></u>{info}')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user