ADD: In case teh SQL server drops the connection with the client, the bot tries again, now on a reopened connection

develop
Kamal Curi 1 year ago
parent f43520e51d
commit 7d1d5398d5

@ -6,6 +6,8 @@ import os
import json
from datetime import datetime, timedelta
from time import sleep
from random import randrange
from discord import Embed, Intents
@ -89,6 +91,10 @@ async def quote(bot: object, *quote: str) -> str:
if ex.args[0].find("Duplicate") != -1:
return await bot.send("There's already a quote from that same person, with that "\
"exact match!")
elif ex.args[0].find("Lost") != -1:
await bot.send("SQL did an oopsie! Trying again...")
sleep(2)
qtid = set_quote(user, quote, date, "#nograb")
return await bot.send(f'{ex.args}\n_What the fuck are you doing?_')
else:
global stack_limit

Loading…
Cancel
Save