Skip to content

Instantly share code, notes, and snippets.

View NotSoSuper's full-sized avatar
🥓
test

NotSoSuper

🥓
test
View GitHub Profile
@NotSoSuper
NotSoSuper / get_images.py
Last active July 23, 2021 01:05
Get Images/Gifs in Discord for commands.
image_mimes = ['image/png', 'image/pjpeg', 'image/jpeg', 'image/x-icon']
async def isimage(url:str):
try:
with aiohttp.ClientSession() as session:
with aiohttp.Timeout(30):
async with session.get(url) as resp:
if resp.status == 200:
mime = resp.headers.get('Content-type', '').lower()
if any([mime == x for x in image_mimes]):
return True
retro_regex = re.compile(r"((https)(\:\/\/|)?u3\.photofunia\.com\/.\/results\/.\/.\/.*(\.jpg\?download))")
@commands.command()
async def retro(self, *, text:str):
if len(text) >= 15:
text = [text[i:i + 15] for i in range(0, len(text), 15)]
else:
split = text.split()
if len(split) == 1:
text = [x for x in text]
else:
@NotSoSuper
NotSoSuper / help.lua
Last active October 25, 2023 16:04
NotSoBot Help Documentation
Complete command list of NotSoBot <439205512425504771>:
Owner: NotSoSuper <296044494812479498>
Prefix: .
* = Not Required
^ = Bot Owner Only
^^ = Server Admin Only
"/'s" in commands show aliases for the command (Ex: ".reverse/r <text>" Command can be run with .reverse or .r)
<max_messages> = The number of messages to search through
<image> = The image URL, @discord_user, the users name, discord/custom emoji, or, nothing inputted which will search through 25 messages for embeds or attachments
<image-face> = Image requires a HUMAN FACE to be included
@NotSoSuper
NotSoSuper / oauth.py
Last active October 15, 2016 17:05
you need your own token but whatever
oauth_regex = r"^https:\/\/discordapp\.com\/oauth2\/authorize\?client_id=(\d+)"
@commands.command(pass_context=True, aliases=['addbot'])
@commands.bot_has_permissions(manage_server=True)
async def oauth(self, ctx, url:str):
regex = re.compile(self.oauth_regex)
match = regex.findall(url)
if len(match) == 1:
client_id = match[0]
else:
await self.bot.say(":exclamation: Invalid OAUTH URL")

Keybase proof

I hereby claim:

  • I am NotSoSuper on github.
  • I am notsosuper (https://keybase.io/notsosuper) on keybase.
  • I have a public key whose fingerprint is 17EF 5190 761D 3C74 0C87 6527 C31C 4CFC 71DF 31A7

To claim this, I am signing this object: