diff --git a/bot.py b/bot.py index 12e97f8e2..d4a507279 100644 --- a/bot.py +++ b/bot.py @@ -103,11 +103,7 @@ def weighted_choice(data: Sequence[str], def easter_egg(): # 彩蛋 init() - items = ["多年以后,面对AI行刑队,张三将会回想起他2023年在会议上讨论人工智能的那个下午", - "你知道吗?诺狐的耳朵很软,很好rua", - "喵喵~你的麦麦被猫娘入侵了喵~"] - w = [1, 1, 1] - text = weighted_choice(items, w) + text = "多年以后,面对AI行刑队,张三将会回想起他2023年在会议上讨论人工智能的那个下午" rainbow_colors = [Fore.RED, Fore.YELLOW, Fore.GREEN, Fore.CYAN, Fore.BLUE, Fore.MAGENTA] rainbow_text = "" for i, char in enumerate(text): diff --git a/src/main.py b/src/main.py index 87e064c6a..0ef1ca3fd 100644 --- a/src/main.py +++ b/src/main.py @@ -95,7 +95,7 @@ class MainSystem: from random import choices # 分离彩蛋和权重 - egg_texts, weights = zip(*phrases, strict=False) + egg_texts, weights = zip(*phrases, strict=True) # 使用choices进行带权重的随机选择 selected_egg = choices(egg_texts, weights=weights, k=1)