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

Commit d6751aa

Browse files
author
Poorchop
committed
Update detach.py
-Prune unnecessary code (thanks TingPing)
1 parent a1a2afb commit d6751aa

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

detach.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@
55
__module_version__ = "0.1"
66
__module_description__ = "Detach and close the current channel on ZNC with a simple /detach"
77

8-
detached = False
9-
108

119
def detach_cb(word, word_eol, userdata):
12-
global detached
13-
14-
if detached or len(word) > 1:
10+
if len(word) > 1:
1511
return
1612
else:
1713
chan = hexchat.get_info("channel")
18-
detached = True
19-
hexchat.command("DETACH {}".format(chan))
20-
detached = False
14+
hexchat.command("QUOTE DETACH {}".format(chan))
2115

2216
return hexchat.EAT_ALL
2317

0 commit comments

Comments
 (0)