-
Notifications
You must be signed in to change notification settings - Fork 0
/
standup.py
38 lines (26 loc) · 899 Bytes
/
standup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import hexchat
__module_name__ = "standup"
__module_version__ = "1.0"
__module_description__ = "stand up"
TIMEOUT = 1800000
standup_hook = None
def enable_standup(word, word_eol, userdata):
global standup_hook
if standup_hook is None:
standup_hook = hexchat.hook_timer(TIMEOUT, standup)
print("standup pluging enabled")
return hexchat.EAT_ALL
def disable_standup(word, word_eol, userdata):
global standup_hook
if standup_hook is not None:
hexchat.unhook(standup_hook)
standup_hook = None
print("standup pluging disabled")
return hexchat.EAT_ALL
def standup(userdata):
print("osoukup: stand up")
return True # keep the timeout going
standup_hook = hexchat.hook_timer(TIMEOUT, standup)
hexchat.hook_command("standup", enable_standup)
hexchat.hook_command("standdown", disable_standup)
print("standup plugin loaded")