diff options
author | jomo <github@jomo.tv> | 2014-07-04 01:50:36 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-07-04 01:50:36 +0200 |
commit | 4791f843560cf7e73438779261233f4046dd93e1 (patch) | |
tree | a567b4788174de8951108755dceb61987fed7775 /motd.py | |
parent | 8ffa50c4369e4626cccd834b21bbed0a92527652 (diff) |
add motd.py
Diffstat (limited to 'motd.py')
-rw-r--r-- | motd.py | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +#pylint: disable=F0401 +from helpers import * + +motd = server.getMotd() + +@hook.command("getmotd") +def onGetMotdCommand(sender, args): + plugHeader("MOTD") + msg(sender, motd, usecolor=False) + + +@hook.command("setmotd") +def onSetMotdCommand(sender, args): + global motd + plugHeader("MOTD") + if sender.hasPermission("utils.setmotd"): + if not checkargs(sender, args, 1, -1): + return True + + motd = colorify(" ".join(args)) + broadcast(plugHeader(name="MOTD")) + broadcast("&aNew MOTD:&r\n%s" % motd) + else: + noperm(sender) + return True + +@hook.event("server.ServerListPingEvent") +def onServerPing(event): + event.setMotd(motd)
\ No newline at end of file |