|
|
|
@ -36,6 +36,8 @@ class DiscordClient(discord.Client):
|
|
|
|
|
self.logger = logger
|
|
|
|
|
self.commands = commands
|
|
|
|
|
self.supported_commands = [
|
|
|
|
|
(re.compile(r'^!lastquote$'), self._do_lastquote),
|
|
|
|
|
(re.compile(r'^!findquote\s+(?P<q>")?(?P<filter>.+)(?(q)")$'), self._do_findquote),
|
|
|
|
|
(re.compile(r'^!(bella(gram|pics)|insta(gram|bella))$'), self._do_bellagram),
|
|
|
|
|
(re.compile(r'^!yt\s+(?P<q>")?(?P<query>.+)(?(q)")$'), self._do_yt),
|
|
|
|
|
(re.compile(r'^!clip\s+(?P<q>")?(?P<filter>.+)(?(q)")$'), self._do_clip),
|
|
|
|
@ -64,6 +66,22 @@ class DiscordClient(discord.Client):
|
|
|
|
|
'Sorry {0}, you have to wait a while before running '
|
|
|
|
|
'the same command again'.format(message.author.mention))
|
|
|
|
|
|
|
|
|
|
async def _do_lastquote(self, server, user, message, **kwargs):
|
|
|
|
|
try:
|
|
|
|
|
result = self.commands.last_quote()
|
|
|
|
|
except CommandError as e:
|
|
|
|
|
await self.send_message(message.channel, 'Sorry {0}, {1}'.format(message.author.mention, e))
|
|
|
|
|
else:
|
|
|
|
|
await self.send_message(message.channel, 'One time, Lilia said this... `#{id}: {text} [{game}] [{date}]`'.format(**result))
|
|
|
|
|
|
|
|
|
|
async def _do_findquote(self, server, user, message, filter, **kwargs):
|
|
|
|
|
try:
|
|
|
|
|
result = self.commands.find_quote(filter)
|
|
|
|
|
except CommandError as e:
|
|
|
|
|
await self.send_message(message.channel, 'Sorry {0}, {1}'.format(message.author.mention, e))
|
|
|
|
|
else:
|
|
|
|
|
await self.send_message(message.channel, 'One time, Lilia said this... `#{id}: {text} [{game}] [{date}]`'.format(**result))
|
|
|
|
|
|
|
|
|
|
@cooldown(retries=2, timeout=5*60, failure=_cooldown_failure)
|
|
|
|
|
async def _do_bellagram(self, server, user, message, **kwargs):
|
|
|
|
|
try:
|
|
|
|
|