Enable user substitution in extra commands

master
Nikola Forró 6 years ago
parent 38b8e04acf
commit d66ece1241

@ -16,5 +16,6 @@ using [HTTP API](https://gitea.brno.mraveniste.cc/turbotraktor/ladylilia.com/src
### Mod-only commands
* `!syncquotes` - performs synchronization of the quotes database with Twitch VODs
* `!command set COMMAND TEXT` - adds a new extra command or updates an existing one
* `!command set COMMAND TEXT` - adds a new extra command or updates an existing one
- instances of `{user}` in `TEXT` will be substituted when the command is executed
* `!command unset COMMAND` - removes an existing extra command

@ -60,7 +60,7 @@ class DiscordClient(discord.Client):
await action(server, message.author.id, message, **m.groupdict())
for cmd, resp in self.extra_commands.items():
if cmd == message.content:
await self.send_message(message.channel, resp)
await self.send_message(message.channel, resp.format(user=message.author.mention))
async def _cooldown_failure(self, server, user, message, **kwargs):
await self.send_message(message.channel,

@ -106,7 +106,7 @@ class TwitchClient(irc.bot.SingleServerIRCBot):
action(tags, send_response, **m.groupdict())
for cmd, resp in self.extra_commands.items():
if cmd == message:
send_response(resp)
send_response(resp.format(user=tags['display-name']))
def _add_quote(self, tags, send_response, user, id, text, game, date, **kwargs):
if text[0] == text[-1] == '"':

Loading…
Cancel
Save