Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. import aiohttp
  4. import io
  5. from tinydb import TinyDB, Query
  6.  
  7. class Client(discord.Client):
  8.  
  9.         def __init__(self):
  10.                 super().__init__()
  11.                 self.__commands = frozenset(['help', 'say', 'status', 'roll', '8ball','setosu', 'osu', 'taiko', 'ctb', 'mania', 'quote', 'backwards'])
  12.  
  13.         @property
  14.         def session(self):
  15.                 return aiohttp.ClientSession()
  16.  
  17.         def parse(self, content, prefix):
  18.                 if content.lower().startswith(prefix) and content.lower() != prefix:
  19.                         args = content[len(prefix):].split(' ')
  20.                         command = args.pop(0).lower()
  21.                         if command in self.__commands:
  22.                                 command = 'cmd_'+command
  23.                                 return command, args
  24.                 return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement