1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-12-04 08:44:21 +00:00
royalnet/royaldiscord.py

21 lines
592 B
Python
Raw Normal View History

2017-03-22 18:13:22 +00:00
import discord
import asyncio
loop = asyncio.get_event_loop()
class ExtraClient:
def __init__(self, token):
self.client = discord.Client()
self.commands = dict()
self.token = token
@self.client.event
async def on_message(message):
split = message.content.split(" ")
command = split[0].lstrip("!")
if command in self.commands:
await self.commands[command](self.client, message, split[1:])
async def run(self):
await self.client.login(self.token)
await self.client.connect()