From 7ff4a6169ba623d72883a966540475a812e47802 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Tue, 14 Nov 2023 22:36:55 -0600 Subject: [PATCH] Per-server hosts --- config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index b20647a..92a8e04 100644 --- a/config.py +++ b/config.py @@ -17,22 +17,26 @@ servers: dict[str, dict[str, Any]] = { "pass": env["ircnow_pass"], "channels": {"#random": 0, "#dice": 0, "#offtopic": 0}, "admins": ["firepup", "h|thelounge", "firepup|lounge"], + "hosts": [], }, "efnet": { "address": "irc.mzima.net", "channels": {"#random": 0, "#dice": 0}, "admins": ["firepup", "h|tl", "fire|tl"], + "hosts": [], }, "replirc": { "address": "localhost", "pass": env["replirc_pass"], "channels": {"#random": 0, "#dice": 0, "#main": 0, "#bots": 0, "#firebot": 0}, "admins": ["firepup", "firepup|lounge", "h|tl"], + "hosts": [], }, "backupbox": { "address": "172.23.11.5", "channels": {"#default": 0}, - "admins": [] + "admins": [], + "hosts": ["172.20.171.225", "169.254.253.107"], } } admin_hosts: list[str] = ["firepup.firepi", "owner.firepi", "47.221.227.180"] @@ -64,4 +68,4 @@ def mfind(message: str, find: list, usePrefix: bool = True) -> bool: return any(message[: len(match)] == match for match in find) def adminCheck(bot: bare.bot, name: str, host: Optional[str] = "nul") -> bool: - return name in servers[bot.server]["admins"] or host in admin_hosts + return name in servers[bot.server]["admins"] or host in admin_hosts or host in servers[bot.server]["hosts"]