diff options
| author | Mistivia <i@mistivia.com> | 2025-10-24 22:24:06 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-10-24 22:24:06 +0800 |
| commit | 2b2ce259241433ca0a3a98a6ea4a37113aed525d (patch) | |
| tree | 158818e7e9df2543a9c154c1f904fad183719445 /ircbot/main.py | |
| parent | ffa71fb8b2e5521f93d8599279af2b28a0795a66 (diff) | |
add teleirc
Diffstat (limited to 'ircbot/main.py')
| -rw-r--r-- | ircbot/main.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ircbot/main.py b/ircbot/main.py index 05aac2b..28745c4 100644 --- a/ircbot/main.py +++ b/ircbot/main.py @@ -13,6 +13,7 @@ NICKNAME = "android" IDENT = NICKNAME REALNAME = "bot" CHANNELS = ["#main", "#ezl9fd7fa13c4bad4f4"] +GREETINGS = ["#main"] LOGPATH = '/volume/webroot/irclog' BUFFER_SIZE = 2048 @@ -56,14 +57,14 @@ def yesterday_log(chan): @command("log") def log_command(chan, sender, args): - log1 = today_log(chan) - log0 = yesterday_log(chan) - return "今天: " + log1 + '\n' + "昨天: " + log0 + return today_log(chan) @command("join") def join_command(chan, sender, args): if sender == NICKNAME: return '' + if not chan in GREETINGS: + return '' return "Dōmo, " + sender + ' san.' @command("dict") @@ -156,9 +157,7 @@ def write_log(channel, nick, msg): return if msg.startswith('!log'): return - if msg.startswith('今天: https://raye.mistivia.com/irclog/') and nick == NICKNAME: - return - if msg.startswith('昨天: https://raye.mistivia.com/irclog/') and nick == NICKNAME: + if msg.startswith('https://raye.mistivia.com/irclog/') and nick == NICKNAME: return now = datetime.datetime.now() base_dir = LOGPATH |
