Blacklist ngircd networks from doing admin shenanigans
This commit is contained in:
parent
d35ac7d970
commit
d5b3484619
2 changed files with 10 additions and 1 deletions
10
checks.py
10
checks.py
|
@ -12,7 +12,15 @@ def admin(
|
||||||
chan: Optional[str] = "",
|
chan: Optional[str] = "",
|
||||||
cmd: Optional[str] = "",
|
cmd: Optional[str] = "",
|
||||||
) -> bool:
|
) -> bool:
|
||||||
if (
|
if bot.server in conf.noAdmins:
|
||||||
|
if not chan:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
bot.msg(
|
||||||
|
f"Sorry {name}, {cmd} is an admin only command, and this network has had admin perms explicitly disabled.",
|
||||||
|
chan,
|
||||||
|
)
|
||||||
|
elif (
|
||||||
name.lower() in bot.adminnames
|
name.lower() in bot.adminnames
|
||||||
or (host or bot.tmpHost) in conf.admin_hosts
|
or (host or bot.tmpHost) in conf.admin_hosts
|
||||||
or (host or bot.tmpHost) in conf.servers[bot.server]["hosts"]
|
or (host or bot.tmpHost) in conf.servers[bot.server]["hosts"]
|
||||||
|
|
|
@ -105,6 +105,7 @@ servers: dict[str, dict[str, Any]] = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
admin_hosts: list[str] = ["firepup.firepi", "69.8.95.218"]
|
admin_hosts: list[str] = ["firepup.firepi", "69.8.95.218"]
|
||||||
|
noAdmins = ["ircnow", "backupbox"]
|
||||||
ESCAPE_SEQUENCE_RE = re.compile(
|
ESCAPE_SEQUENCE_RE = re.compile(
|
||||||
r"""
|
r"""
|
||||||
( \\U........ # 8-digit hex escapes
|
( \\U........ # 8-digit hex escapes
|
||||||
|
|
Loading…
Add table
Reference in a new issue