summaryrefslogtreecommitdiff
path: root/motd.py
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2014-07-24 02:31:34 +0200
committerjomo <github@jomo.tv>2014-07-24 02:31:34 +0200
commitfb60c0c1782845b535f692a74bc1f81c3392708f (patch)
treec7ddca58dd3f43ec44b48c68ad9023371cf3b77c /motd.py
parentbdabfc00542553073af7ebcfcfc1e500a633f516 (diff)
allow to reset motd
Diffstat (limited to 'motd.py')
-rw-r--r--motd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/motd.py b/motd.py
index 36f64e1..1b70a29 100644
--- a/motd.py
+++ b/motd.py
@@ -1,7 +1,8 @@
#pylint: disable = F0401
from helpers import *
-motd = colorify(server.getMotd())
+default_motd = colorify(server.getMotd())
+motd = default_motd
@hook.command("getmotd")
def on_getmotd_command(sender, args):
@@ -17,6 +18,10 @@ def on_setmotd_command(sender, args):
return True
motd = colorify(" ".join(args).replace("\\n", "\n"))
+
+ if motd == "--reset":
+ motd = default_motd
+
broadcast(None, plugin_header(name="MOTD"))
broadcast(None, "&aNew MOTD:&r\n%s" % motd)
broadcast(None, " ")