feat(彩蛋): 增加彩蛋文本的随机性
在 `easter_egg` 函数中引入了随机数生成逻辑。 现在有20%的概率显示猫娘文本,80%的概率显示一个原有的文本,增加了趣味性。
This commit is contained in:
7
bot.py
7
bot.py
@@ -15,6 +15,7 @@ import platform
|
|||||||
import traceback
|
import traceback
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from rich.traceback import install
|
from rich.traceback import install
|
||||||
|
from random import randint
|
||||||
|
|
||||||
# maim_message imports for console input
|
# maim_message imports for console input
|
||||||
|
|
||||||
@@ -68,7 +69,11 @@ def easter_egg():
|
|||||||
from colorama import init, Fore
|
from colorama import init, Fore
|
||||||
|
|
||||||
init()
|
init()
|
||||||
text = "喵喵~你的麦麦被猫娘入侵了喵~"
|
a = randint(1,10)
|
||||||
|
if a<2:
|
||||||
|
text = "喵喵~你的麦麦被猫娘入侵了喵~"
|
||||||
|
else:
|
||||||
|
text = "多年以后,面对AI行刑队,张三将会回想起他2023年在会议上讨论人工智能的那个下午"
|
||||||
rainbow_colors = [Fore.RED, Fore.YELLOW, Fore.GREEN, Fore.CYAN, Fore.BLUE, Fore.MAGENTA]
|
rainbow_colors = [Fore.RED, Fore.YELLOW, Fore.GREEN, Fore.CYAN, Fore.BLUE, Fore.MAGENTA]
|
||||||
rainbow_text = ""
|
rainbow_text = ""
|
||||||
for i, char in enumerate(text):
|
for i, char in enumerate(text):
|
||||||
|
|||||||
Reference in New Issue
Block a user