forked from Firepup650/FireBot
add a channel, and override nicklen limits for bridges
This commit is contained in:
parent
81931e5d2b
commit
9bf199bb48
2 changed files with 10 additions and 2 deletions
|
@ -34,7 +34,7 @@ servers: dict[str, dict[str, Any]] = {
|
||||||
},
|
},
|
||||||
"backupbox": {
|
"backupbox": {
|
||||||
"address": "172.23.11.5",
|
"address": "172.23.11.5",
|
||||||
"channels": {"#default": 0, "#botrebellion": 0},
|
"channels": {"#default": 0, "#botrebellion": 0, "#main/replirc": 0},
|
||||||
"admins": [],
|
"admins": [],
|
||||||
"hosts": ["172.20.171.225", "169.254.253.107"],
|
"hosts": ["172.20.171.225", "169.254.253.107"],
|
||||||
},
|
},
|
||||||
|
|
10
handlers.py
10
handlers.py
|
@ -45,15 +45,20 @@ def PRIVMSG(bot: bare.bot, msg: str) -> tuple[Union[None, str], Union[None, str]
|
||||||
# Format of ":[Nick]![ident]@[host|vhost] PRIVMSG [channel] :[message]”
|
# Format of ":[Nick]![ident]@[host|vhost] PRIVMSG [channel] :[message]”
|
||||||
name = msg.split("!", 1)[0][1:]
|
name = msg.split("!", 1)[0][1:]
|
||||||
host = msg.split("@", 1)[1].split(" ", 1)[0]
|
host = msg.split("@", 1)[1].split(" ", 1)[0]
|
||||||
|
bridge = False
|
||||||
if (
|
if (
|
||||||
(name.startswith("saxjax") and bot.server == "efnet")
|
(name.startswith("saxjax") and bot.server == "efnet")
|
||||||
or (name == "ReplIRC" and bot.server == "replirc")
|
or (name == "ReplIRC" and bot.server == "replirc")
|
||||||
or (name == "FirePyLink_" and bot.server == "ircnow")
|
or (name == "FirePyLink_" and bot.server == "ircnow")
|
||||||
|
or (name == "FirePyLink" and bot.server == "backupbox")
|
||||||
):
|
):
|
||||||
if "<" in msg and ">" in msg:
|
if "<" in msg and ">" in msg:
|
||||||
|
bridge = True
|
||||||
Nname = msg.split("<", 1)[1].split(">", 1)[0].strip()
|
Nname = msg.split("<", 1)[1].split(">", 1)[0].strip()
|
||||||
if name == "ReplIRC":
|
if name == "ReplIRC":
|
||||||
name = Nname[4:]
|
name = Nname[4:]
|
||||||
|
elif name in ["FirePyLink_", "FirePyLink"]:
|
||||||
|
name = Nname.lstrip("@%~+")[3:-1]
|
||||||
else:
|
else:
|
||||||
name = Nname
|
name = Nname
|
||||||
message = msg.split(">", 1)[1].strip()
|
message = msg.split(">", 1)[1].strip()
|
||||||
|
@ -69,7 +74,10 @@ def PRIVMSG(bot: bare.bot, msg: str) -> tuple[Union[None, str], Union[None, str]
|
||||||
)
|
)
|
||||||
if len(name) > bot.nicklen:
|
if len(name) > bot.nicklen:
|
||||||
bot.log(f"Name too long ({len(name)} > {bot.nicklen})")
|
bot.log(f"Name too long ({len(name)} > {bot.nicklen})")
|
||||||
return None, None
|
if not bridge:
|
||||||
|
return None, None
|
||||||
|
else:
|
||||||
|
bot.log("This user is a bridge, overriding")
|
||||||
elif chan not in bot.channels:
|
elif chan not in bot.channels:
|
||||||
if not chan == bot.nick:
|
if not chan == bot.nick:
|
||||||
bot.log(
|
bot.log(
|
||||||
|
|
Loading…
Reference in a new issue