Add CTCP VERSION support
This commit is contained in:
parent
5108822594
commit
4e41dfe47a
@ -24,6 +24,7 @@ import fnmatch
|
|||||||
import itertools
|
import itertools
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import signal
|
import signal
|
||||||
@ -6562,6 +6563,14 @@ def relay(cli, nick, chan, rest):
|
|||||||
if rest.startswith("\u0001PING"):
|
if rest.startswith("\u0001PING"):
|
||||||
cli.notice(nick, rest)
|
cli.notice(nick, rest)
|
||||||
return
|
return
|
||||||
|
if rest == "\u0001VERSION\u0001":
|
||||||
|
try:
|
||||||
|
ans = subprocess.check_output(["git", "log", "-n", "1", "--pretty=format:%h"])
|
||||||
|
reply = "\u0001VERSION lykos {0}, Python {1} -- https://github.com/lykoss/lykos\u0001".format(str(ans.decode()), platform.python_version())
|
||||||
|
except (OSError, subprocess.CalledProcessError):
|
||||||
|
reply = "\u0001VERSION lykos, Python {0} -- https://github.com/lykoss/lykos\u0001".format(platform.python_version())
|
||||||
|
cli.notice(nick, reply)
|
||||||
|
return
|
||||||
if var.PHASE not in ("night", "day"):
|
if var.PHASE not in ("night", "day"):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user