mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
21 lines
No EOL
592 B
Python
21 lines
No EOL
592 B
Python
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() |