improved naming in stan.py
This commit is contained in:
+1
-1
@@ -314,7 +314,7 @@ def handle_msg(message: types.Message):
|
|||||||
else:
|
else:
|
||||||
s['Messages'][message.from_user.id]['Count'] += 1
|
s['Messages'][message.from_user.id]['Count'] += 1
|
||||||
|
|
||||||
quote = stan.speak(25)
|
quote = stan.speak(30)
|
||||||
if quote:
|
if quote:
|
||||||
threading.Thread(target=send_quote, args=(len(quote) * 0.13, message, quote)).start()
|
threading.Thread(target=send_quote, args=(len(quote) * 0.13, message, quote)).start()
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
""" Stan quote generator. """
|
""" Stan quote generator. """
|
||||||
import random
|
import random
|
||||||
|
|
||||||
stan = [i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')]
|
quotes = [i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')]
|
||||||
|
|
||||||
|
|
||||||
def speak(chance):
|
def speak(chance_of):
|
||||||
chance = random.randint(0, chance)
|
number = random.randint(0, chance_of)
|
||||||
if chance == 0:
|
if number == 0:
|
||||||
return random.choice(stan)
|
return random.choice(quotes)
|
||||||
|
|||||||
Reference in New Issue
Block a user