From 8cddd9316a15f0688c405e53cae95b1216ac50bf Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 14 May 2019 09:06:42 +0000 Subject: [PATCH] Import the correct function for RANDOM() --- 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 +++ a/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 @@ 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] -- rgit 0.1.3