Skip to content

Instantly share code, notes, and snippets.

View zhudotexe's full-sized avatar

Andrew Zhu zhudotexe

View GitHub Profile
'''
Created on Jan 14, 2017
@author: andrew
'''
import asyncio
import pickle
import sys
import traceback
'''
Created on Jan 14, 2017
@author: andrew
'''
import asyncio
import datetime
from os.path import isfile
import pickle
import re
from discord.ext import commands
import discord.utils
#
# This is a modified version of checks.py, originally made by Rapptz
#
# https://github.com/Rapptz
# https://github.com/Rapptz/RoboDanny/tree/async
#
@commands.command(hidden=True, pass_context=True)
@checks.is_owner()
async def assume_direct_control(self, ctx, chan:str):
"""Assumes direct control of Avrae."""
def cleanup_code(content):
"""Automatically removes code blocks from the code."""
# remove ```py\n```
if content.startswith('```') and content.endswith('```'):
return '\n'.join(content.split('\n')[1:-1])
'''
Created on Sep 18, 2016
@author: andrew
'''
import asyncio
from math import floor
from os.path import isfile
import pickle
import random
'''
Created on Mar 27, 2017
@author: andrew
'''
import copy
import os
import signal
import subprocess
import sys
'''
Created on Dec 25, 2016
@author: andrew
'''
from heapq import nlargest, nsmallest
from math import floor
import random
from re import IGNORECASE
import re
'''
Created on Jan 17, 2017
@author: andrew
'''
import asyncio
import inspect
import itertools
import re
'''
Created on Dec 25, 2016
@author: andrew
'''
from heapq import nlargest, nsmallest
import random
from re import IGNORECASE
import re
'''
Created on Oct 29, 2016
@author: andrew
'''
import errno
import os
import re
from fuzzywuzzy import process, fuzz