1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-26 21:14:19 +00:00

🐛 Fix /fortune seed

This commit is contained in:
Steffo 2021-04-30 12:45:20 +02:00
parent bf52806bbc
commit 521b3d9251
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,5 +1,6 @@
import royalnet.engineer as engi
import random
import datetime
# Tutte le fortunes qui devono essere positive :)
@ -63,7 +64,7 @@ async def fortune(*, _msg: engi.Message, **__):
author = await _msg.sender
r = random.Random(x=author)
r = random.Random(x=hash(author) + hash(datetime.date.today()))
message = r.sample(_fortunes, 1)[0]
await _msg.reply(text=message)