|
|
@ -50,11 +50,14 @@ class DiscordClient(discord.Client):
|
|
|
|
self.logger.info('Logged in as {0}'.format(self.user.name))
|
|
|
|
self.logger.info('Logged in as {0}'.format(self.user.name))
|
|
|
|
|
|
|
|
|
|
|
|
async def on_message(self, message):
|
|
|
|
async def on_message(self, message):
|
|
|
|
|
|
|
|
server = message.server.id if message.server else None
|
|
|
|
for pattern, action in self.supported_commands:
|
|
|
|
for pattern, action in self.supported_commands:
|
|
|
|
m = pattern.match(message.content)
|
|
|
|
m = pattern.match(message.content)
|
|
|
|
if m:
|
|
|
|
if m:
|
|
|
|
server = message.server.id if message.server else None
|
|
|
|
|
|
|
|
await action(server, message.author.id, message, **m.groupdict())
|
|
|
|
await action(server, message.author.id, message, **m.groupdict())
|
|
|
|
|
|
|
|
for cmd, resp in self.config['Extra Commands'].items():
|
|
|
|
|
|
|
|
if cmd == message.content:
|
|
|
|
|
|
|
|
await self.send_message(message.channel, resp)
|
|
|
|
|
|
|
|
|
|
|
|
async def _cooldown_failure(self, server, user, message, **kwargs):
|
|
|
|
async def _cooldown_failure(self, server, user, message, **kwargs):
|
|
|
|
await self.send_message(message.channel,
|
|
|
|
await self.send_message(message.channel,
|
|
|
|