|
|
|
@ -5,6 +5,7 @@ import logging
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
import json
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
from random import choice
|
|
|
|
|
|
|
|
|
@ -44,7 +45,8 @@ async def quote(bot: object, *quote: str) -> str:
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
user = bot.author.name
|
|
|
|
|
qtid = set_quote(user, quote)
|
|
|
|
|
date = datetime.now().replace(microsecond=0)
|
|
|
|
|
qtid = set_quote(user, quote, date)
|
|
|
|
|
except Exception as ex:
|
|
|
|
|
if ex.args[0].find("Duplicate") != -1:
|
|
|
|
|
return await bot.send("There's already a quote from that same person, with that "\
|
|
|
|
@ -116,6 +118,28 @@ async def by_id(bot: object, _id: int=None) -> str:
|
|
|
|
|
return await bot.send(ex)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@client.command(aliases=['qinfo'])
|
|
|
|
|
async def quote_info(bot: object, _id: int=None) -> str:
|
|
|
|
|
"""
|
|
|
|
|
Prints out information about a quote
|
|
|
|
|
"""
|
|
|
|
|
syntax = "--qinfo <quote id>"
|
|
|
|
|
|
|
|
|
|
if not _id:
|
|
|
|
|
return await bot.send("_If you don't tell me the ID, how the fuck do you expect me to "\
|
|
|
|
|
f"get its info for you!?_\n(The correct syntax is {syntax})")
|
|
|
|
|
|
|
|
|
|
quote = get_by_id(_id)
|
|
|
|
|
|
|
|
|
|
if not quote:
|
|
|
|
|
return await bot.send(f"_Wrong ID, sucker!_\n(There's no such quote with id {_id})")
|
|
|
|
|
|
|
|
|
|
user = quote.user
|
|
|
|
|
date = quote.date if quote.date else "Before datetimes were stored"
|
|
|
|
|
data = f"```\n ID: {_id}\n Quoted by: {user}\n Quoted datetime: {date}\n```"
|
|
|
|
|
return await bot.send(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@client.command(aliases=['dq'])
|
|
|
|
|
async def delete_quote(bot, _id: int=None) -> str:
|
|
|
|
|
"""
|
|
|
|
|