🏡 index : ~doyle/dave.git

author dave <dave@ip-172-26-11-212.eu-west-2.compute.internal> 2019-05-14 9:06:42.0 +00:00:00
committer dave <dave@ip-172-26-11-212.eu-west-2.compute.internal> 2019-05-14 9:06:42.0 +00:00:00
commit
8cddd9316a15f0688c405e53cae95b1216ac50bf [patch]
tree
f06ac93fb520f4dbc2a322118f087467903c9dd0
parent
81707fe9dc5cb09364f7da526010848e64b9ec3f
download
8cddd9316a15f0688c405e53cae95b1216ac50bf.tar.gz

Import the correct function for RANDOM()



Diff

 dave/modules/quote.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dave/modules/quote.py b/dave/modules/quote.py
index ed0a22b..7116190 100644
--- a/dave/modules/quote.py
+++ b/dave/modules/quote.py
@@ -1,6 +1,6 @@
"""Quote system"""
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.sql.expression import func
from sqlalchemy.sql.functions import random as sqlrandom
import dave.module
import dave.config
import uuid
@@ -35,7 +35,7 @@ def quote(bot, args, sender, source):
        bot.reply(source, sender, "No quotes found.")
        return

    row = query.order_by(func.random()).first()
    row = query.order_by(sqlrandom()).first()

    bot.reply(source, sender, assembleFormattedText(A.normal[
        "<{}> ".format(row.attributed.strip()) if row.attributed else "", A.bold[row.quote]