Skip to content
This repository was archived by the owner on Jun 9, 2019. It is now read-only.

Commit a1a2afb

Browse files
author
Poorchop
committed
Create detach.py
1 parent 1ee8866 commit a1a2afb

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

detach.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import hexchat
2+
3+
__module_name__ = "Detach"
4+
__module_author__ = "Poorchop"
5+
__module_version__ = "0.1"
6+
__module_description__ = "Detach and close the current channel on ZNC with a simple /detach"
7+
8+
detached = False
9+
10+
11+
def detach_cb(word, word_eol, userdata):
12+
global detached
13+
14+
if detached or len(word) > 1:
15+
return
16+
else:
17+
chan = hexchat.get_info("channel")
18+
detached = True
19+
hexchat.command("DETACH {}".format(chan))
20+
detached = False
21+
22+
return hexchat.EAT_ALL
23+
24+
25+
hexchat.hook_command("DETACH", detach_cb)
26+
27+
hexchat.prnt(__module_name__ + " version " + __module_version__ + " loaded")

0 commit comments

Comments
 (0)