From 294ce30133a67f5b2ca384a4358c5f39f6b60acc Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 11 Dec 2018 19:42:42 +0100 Subject: [PATCH] Add an environment variable for configuring the Tupperware instance to check for --- src/pluralkit/bot/commands/import_commands.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pluralkit/bot/commands/import_commands.py b/src/pluralkit/bot/commands/import_commands.py index 802bd836..852fafe2 100644 --- a/src/pluralkit/bot/commands/import_commands.py +++ b/src/pluralkit/bot/commands/import_commands.py @@ -1,3 +1,4 @@ +import os from datetime import datetime from pluralkit.bot.commands import * @@ -11,7 +12,11 @@ async def import_root(ctx: CommandContext): async def import_tupperware(ctx: CommandContext): # Check if there's a Tupperware bot on the server # Main instance of TW has that ID, at least - tupperware_member = ctx.message.guild.get_member(431544605209788416) + tupperware_id = 431544605209788416 + if "TUPPERWARE_ID" in os.environ: + tupperware_id = int(os.environ["TUPPERWARE_ID"]) + + tupperware_member = ctx.message.guild.get_member(tupperware_id) if not tupperware_member: raise CommandError("This command only works in a server where the Tupperware bot is also present.")