python_bot/dicktxt/WordsChange.py
hogweed1 81db0b2bdb
All checks were successful
continuous-integration/drone/push Build is passing
море спася геноцид
2025-05-12 21:57:58 +10:00

21 lines
764 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import yaml
import random
def ChangeWord(result): бiрає будь-якое слiво для змєнєння розмiра пiпiси
with open("dicktxt/dick_changes.yaml", 'r', encoding='utf-8') as f:
words = yaml.load(f, Loader=yaml.Loader)
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'] ]
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