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:
I hereby claim:
To claim this, I am signing this object:
| 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") |
| 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 |
| 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: |
| 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 |
| @commands.command(pass_context=True) | |
| @commands.cooldown(1, 5) | |
| async def react(self, ctx, *, txt:str): | |
| msg = None | |
| for s in txt.split(): | |
| if s.isdigit(): | |
| if len(s) > 10: | |
| msg = await self.bot.get_message(ctx.message.channel, s) | |
| txt = txt.replace(s, '') | |
| break |
| import asyncio | |
| import discord | |
| import aiohttp | |
| import re | |
| import aiohttp | |
| import random | |
| import sys | |
| import os | |
| import aiosocks | |
| import time |
| from lxml import etree | |
| #http://stackoverflow.com/a/34084933 | |
| def get_deep_text(element): | |
| try: | |
| text = element.text or '' | |
| for subelement in element: | |
| text += get_deep_text(subelement) | |
| text += element.tail or '' | |
| return text |
| def do_gmagik(self, ctx, gif): | |
| try: | |
| try: | |
| gif = PIL.Image.open(gif) | |
| except: | |
| return '\N{WARNING SIGN} Invalid Gif.' | |
| if gif.size >= (3000, 3000): | |
| return '\N{WARNING SIGN} `GIF resolution exceeds maximum >= (3000, 3000).`' | |
| elif gif.n_frames > 150 and ctx.message.author.id != self.bot.owner.id: | |
| return "\N{WARNING SIGN} `GIF has too many frames (> 150 Frames).`" |
| import os | |
| cows = os.listdir('/usr/share/cowsay/cows') | |
| base = r""" | |
| @commands.command(aliases=['{0}']) | |
| async def {1}say(self, *, txt:str): | |
| msg = await self.do_cowsay(txt, '{0}') | |
| await self.bot.say("```\n"+msg[:1992]+"```") | |
| """ |