|
|
|
@ -12,7 +12,7 @@ from discord import Embed, Intents
|
|
|
|
|
from discord.ext import commands
|
|
|
|
|
from settings.config import IMAGE_TYPES, OW_API_CONFIG, PERMISSIONS, QUOTE_STACK, RQ_LEADERBOARD, ROULETTE_LEADERBOARD
|
|
|
|
|
|
|
|
|
|
from utils.database import (count_quotes, count_quotes_user, get_by_id, get_quote_contains,
|
|
|
|
|
from utils.database import (count_quotes, count_quotes_user, get_by_id, get_by_user, get_quote_contains,
|
|
|
|
|
get_quotes, remove_quote, set_quote)
|
|
|
|
|
from utils.machine_monitor import Monitor
|
|
|
|
|
from utils.news_paper import News
|
|
|
|
@ -227,6 +227,36 @@ async def by_id(bot: object, _id: int=None) -> str:
|
|
|
|
|
except Exception as ex:
|
|
|
|
|
return await bot.send(ex)
|
|
|
|
|
|
|
|
|
|
@client.command(aliases=['quser'])
|
|
|
|
|
async def by_user(bot: object, *user: str) -> str:
|
|
|
|
|
"""
|
|
|
|
|
Gets one random quote from a specific user.
|
|
|
|
|
"""
|
|
|
|
|
syntax = "`--quser <user>`"
|
|
|
|
|
|
|
|
|
|
if not user:
|
|
|
|
|
return await bot.send(f"The correct syntax is {syntax}")
|
|
|
|
|
|
|
|
|
|
user = user[0]
|
|
|
|
|
|
|
|
|
|
quote = get_by_user(user)
|
|
|
|
|
|
|
|
|
|
if not quote:
|
|
|
|
|
return await bot.send(f"There are no quotes from {user}")
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
data = ''
|
|
|
|
|
# To image links.
|
|
|
|
|
if 'http' in quote.quote:
|
|
|
|
|
return await bot.send(f'{quote.quote}')
|
|
|
|
|
if quote.grabber == "#nograb":
|
|
|
|
|
data = f'{quote.quote}\n`By: {quote.user}`'
|
|
|
|
|
else:
|
|
|
|
|
data = f'{quote.quote}\n`By: {quote.user} and grabbed by {quote.grabber}`'
|
|
|
|
|
return await bot.send(data)
|
|
|
|
|
|
|
|
|
|
except Exception as ex:
|
|
|
|
|
return await bot.send(ex)
|
|
|
|
|
|
|
|
|
|
@client.command(aliases=['qinfo'])
|
|
|
|
|
async def quote_info(bot: object, _id: str=None) -> str:
|
|
|
|
|