diff options
| author | Mistivia <i@mistivia.com> | 2025-11-06 01:29:23 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-06 01:29:23 +0800 |
| commit | e488e983626475438b6f4802fae4defe77a3e397 (patch) | |
| tree | 2c24d48e3900d9295554648c8aed1a6520d8db73 | |
| parent | 95caa5bdaff4e5b5a924a9141b51c756a57abc0f (diff) | |
update config and bot
| -rw-r--r-- | ergo/ircd.yaml | 2 | ||||
| -rw-r--r-- | ircbot/main.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/ergo/ircd.yaml b/ergo/ircd.yaml index b0920b2..5fb979e 100644 --- a/ergo/ircd.yaml +++ b/ergo/ircd.yaml @@ -142,7 +142,7 @@ server: # 'rfc1459-strict'. we recommend leaving this value at its default; # however, note that changing it once the network is already up and running is # problematic. - casemapping: "ascii" + casemapping: "permissive" # enforce-utf8 controls whether the server will preemptively discard non-UTF8 # messages (since they cannot be relayed to websocket clients), or will allow diff --git a/ircbot/main.py b/ircbot/main.py index db49a8e..b65b428 100644 --- a/ircbot/main.py +++ b/ircbot/main.py @@ -22,7 +22,7 @@ REALNAME = config['realname'] CHANNELS = config['channels'] GREETINGS = config['greetings'] LOGPATH = config['logpath'] -RELAYBOT = config['relaybot'] +RELAYBOTS = config['relaybots'] IDENT = NICKNAME @@ -501,8 +501,9 @@ class IRCBot: print(f"[{target}] <{sender_nick}>: {message}") write_log(target, sender_nick, message) reply_target = target if target.startswith('#') else sender_nick - + is_cmd = False if message.startswith("!") or message.startswith("!"): + is_cmd = True try: cmd_parts = message[1:].split() cmd = cmd_parts[0].lower() @@ -510,12 +511,13 @@ class IRCBot: self.handle_command(sender_nick, reply_target, cmd, args) except IndexError: pass - elif sender_nick == RELAYBOT: + elif sender_nick in RELAYBOTS: end_of_nick_index = message.find('>') nick = message[1:end_of_nick_index] msg_start_index = end_of_nick_index + 2 msg = message[msg_start_index:].strip() if msg.startswith("!") or msg.startswith("!"): + is_cmd = True try: cmd_parts = msg[1:].split() cmd = cmd_parts[0].lower() @@ -524,7 +526,7 @@ class IRCBot: self.handle_command(nick, reply_target, cmd, args) except IndexError: pass - else: + if not is_cmd: titles = url_titles(message) if len(titles) > 0: for t in titles: |
