|
|
|
@ -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
|
|
|
|
@ -18,7 +20,6 @@ from utils.machine_monitor import Monitor
|
|
|
|
|
from utils.news_paper import News
|
|
|
|
|
from utils.tools import datetime_to_string, kbytes_to_gbytes
|
|
|
|
|
from utils.weather import displayweather, getweatherdata
|
|
|
|
|
from utils.ipm import ipm_check
|
|
|
|
|
|
|
|
|
|
client = commands.Bot(command_prefix='--', intents=Intents.all())
|
|
|
|
|
|
|
|
|
@ -90,6 +91,11 @@ 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"Done: `{quote}\n` ID: `{qtid}`")
|
|
|
|
|
return await bot.send(f'{ex.args}\n_What the fuck are you doing?_')
|
|
|
|
|
else:
|
|
|
|
|
global stack_limit
|
|
|
|
@ -138,7 +144,13 @@ async def random_quote(bot: object) -> str:
|
|
|
|
|
global last_rq
|
|
|
|
|
global last_rqer
|
|
|
|
|
global rq_abusers
|
|
|
|
|
chosen_one = get_quotes(quote_id_stack)
|
|
|
|
|
try:
|
|
|
|
|
chosen_one = get_quotes(quote_id_stack)
|
|
|
|
|
except Exception as ex:
|
|
|
|
|
if ex.args[0].find("Lost") != -1:
|
|
|
|
|
await bot.send("SQL did an oopsie! Trying again...")
|
|
|
|
|
sleep(2)
|
|
|
|
|
chosen_one = get_quotes(quote_id_stack)
|
|
|
|
|
stack_len = len(quote_id_stack)
|
|
|
|
|
|
|
|
|
|
# The next two IF statements are meant to deal with `--rq` abuse
|
|
|
|
@ -424,6 +436,8 @@ async def weather(bot: object, *location: str) -> str:
|
|
|
|
|
value=f'{msg.wind_speed} m/s' if msg.wind_speed else default_msg,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
embed.set_footer(text="Provided by Openweather.org")
|
|
|
|
|
|
|
|
|
|
return await bot.send('**`Weather`**', embed=embed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -680,16 +694,14 @@ async def neeble_debug(bot:object) -> str:
|
|
|
|
|
Outputs debug data.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# # TODO: This is repeated role checking code from the deletion function, better make this into one function itself
|
|
|
|
|
# roles = [r.name for r in bot.author.roles]
|
|
|
|
|
# PermStatus = False
|
|
|
|
|
#
|
|
|
|
|
# if len(PERMISSIONS['dq']) < 1 or not len(set(PERMISSIONS['dq']).intersection(roles)) < 1:
|
|
|
|
|
# PermStatus = True
|
|
|
|
|
# TODO: This is repeated role checking code from the deletion function, better make this into one function itself
|
|
|
|
|
roles = [r.name for r in bot.author.roles]
|
|
|
|
|
PermStatus = False
|
|
|
|
|
|
|
|
|
|
PermStatus = ipm_check(bot.author.name, "mgmt.dbg")
|
|
|
|
|
if len(PERMISSIONS['dq']) < 1 or not len(set(PERMISSIONS['dq']).intersection(roles)) < 1:
|
|
|
|
|
PermStatus = True
|
|
|
|
|
|
|
|
|
|
if PermStatus is False:
|
|
|
|
|
if not PermStatus:
|
|
|
|
|
return await bot.send("_And who the fuck do **YOU** think you are!?_.\n"\
|
|
|
|
|
"(You don't have the necessary role for this command)")
|
|
|
|
|
clock = comlock
|
|
|
|
|