diff --git a/clients/discord.py b/clients/discord.py index ab4e07c..83ed84d 100644 --- a/clients/discord.py +++ b/clients/discord.py @@ -67,13 +67,18 @@ class DiscordClient(discord.Client): 'Sorry {0}, you have to wait a while before running ' 'the same command again'.format(message.author.mention)) + def _format_quote(self, quote): + if '"' not in quote['text']: + quote['text'] = '"{0}"'.format(quote['text']) + return 'One time, Lilia said this... `#{id}: {text} [{game}] [{date}]`'.format(**quote) + 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)) + await self.send_message(message.channel, self._format_quote(result)) async def _do_findquote(self, server, user, message, filter, **kwargs): try: @@ -81,7 +86,7 @@ class DiscordClient(discord.Client): 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)) + await self.send_message(message.channel, self._format_quote(result)) @cooldown(retries=2, timeout=5*60, failure=_cooldown_failure) async def _do_bellagram(self, server, user, message, **kwargs): diff --git a/clients/twitch.py b/clients/twitch.py index 31b2d91..9ef1e9f 100644 --- a/clients/twitch.py +++ b/clients/twitch.py @@ -108,6 +108,11 @@ class TwitchClient(irc.bot.SingleServerIRCBot): if cmd == message: send_response(resp.format(user=tags['display-name'])) + def _format_quote(self, quote): + if '"' not in quote['text']: + quote['text'] = '"{0}"'.format(quote['text']) + return 'One time, Lilia said this... #{id}: {text} [{game}] [{date}]'.format(**quote) + def _add_quote(self, tags, send_response, user, id, text, game, date, **kwargs): if text[0] == text[-1] == '"': text = text[1:-1] @@ -142,7 +147,7 @@ class TwitchClient(irc.bot.SingleServerIRCBot): if self.config['Quotes'].getboolean('act_as_proxy'): send_response('!quote {0}'.format(quote['id'])) else: - send_response('One time, Lilia said this... #{id}: "{text}" [{game}] [{date}]'.format(**quote)) + send_response(self._format_quote(quote)) def _do_findquote(self, tags, send_response, filter, **kwargs): try: @@ -153,7 +158,7 @@ class TwitchClient(irc.bot.SingleServerIRCBot): if self.config['Quotes'].getboolean('act_as_proxy'): send_response('!quote {0}'.format(quote['id'])) else: - send_response('One time, Lilia said this... #{id}: "{text}" [{game}] [{date}]'.format(**quote)) + send_response(self._format_quote(quote)) def _do_syncquotes(self, tags, send_response, **kwargs): if not self._is_mod(tags):