diff options
| author | Mistivia <i@mistivia.com> | 2025-11-03 00:02:21 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-11-03 00:02:32 +0800 |
| commit | 848f1214153f7b8af2a243ade2799b4d3fc4e2bc (patch) | |
| tree | 0ca3d14459741fa3b74bf5ea33f106b913b0f33f | |
| parent | 2e8aa12d3314817add8fa3fecd873fbf09f297ca (diff) | |
update meet link
| -rw-r--r-- | ircbot/main.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ircbot/main.py b/ircbot/main.py index 8d59037..a7c8c3a 100644 --- a/ircbot/main.py +++ b/ircbot/main.py @@ -72,14 +72,23 @@ def memo_cmd(chan, sender, args): save_memos() return '已留言' +meetlink = dict() +meettime = dict() + @command("meet") def meet_cmd(chan, sender, args): - data_to_hash = SERVER + chan + '#' + str(int(time.time()) // 120) + if chan in meetlink and chan in meettime: + if time.time() - meettime[chan] < 120: + return meetlink[chan] + data_to_hash = SERVER + chan + '#' + str(time.time()) data_bytes = data_to_hash.encode('utf-8') hash_object = hashlib.sha256() hash_object.update(data_bytes) hex_digest = hash_object.hexdigest() - return '加入会议: https://meet.jit.si/' + hex_digest[:24] + '#config.startWithVideoMuted=true' + link = '加入会议: https://meet.jit.si/' + hex_digest[:24] + '#config.startWithVideoMuted=true' + meetlink[chan] = link + meettime[chan] = time.time() + return link @command("log") def log_command(chan, sender, args): |
