python_bot_v2/dicktxt/WordsChange.py

21 lines
776 B
Python
Raw Normal View History

2024-01-22 02:59:25 +10:00
import yaml
import random
def ChangeWord(result): #выбирает рандомное слово для изменения размера пиписы
2024-01-23 02:18:50 +10:00
with open("dicktxt/dick_changes.yaml", 'r', encoding='utf-8') as f:
2024-01-22 02:59:25 +10:00
words = yaml.load(f, Loader=yaml.Loader)
2024-01-22 03:26:08 +10:00
dick_inc = [ f'<b>{w}</b>' for w in words['increment'] ]
dick_static = [ f'<b>{w}</b>' for w in words['nothing'] ]
dick_decr = [ f'<b>{w}</b>' for w in words['decrement'] ]
2024-01-22 02:59:25 +10:00
if result > 0:
size_change = random.choice(dick_inc) + '🚀'
elif result == 0:
size_change = random.choice(dick_static) + '🤨'
else:
size_change = random.choice(dick_decr) + ''
return size_change