removed camelcase, added more coding style to readme

This commit is contained in:
jomo
2014-07-16 00:33:43 +02:00
parent d2ec8b6d3f
commit 1430a454ed
19 changed files with 221 additions and 134 deletions

12
motd.py
View File

@@ -3,27 +3,29 @@ from helpers import *
motd = server.getMotd()
@hook.command("getmotd")
def onGetMotdCommand(sender, args):
plugHeader(sender, "MOTD")
def on_getmotd_command(sender, args):
plugin_header(sender, "MOTD")
msg(sender, motd, usecolor=False)
@hook.command("setmotd")
def onSetMotdCommand(sender, args):
def on_setmotd_command(sender, args):
global motd
if sender.hasPermission("utils.setmotd"):
if not checkargs(sender, args, 1, -1):
return True
motd = colorify(" ".join(args).replace("\\n", "\n"))
broadcast("", plugHeader(name="MOTD"))
broadcast("", plugin_header(name="MOTD"))
broadcast("", "&aNew MOTD:&r\n%s" % motd)
broadcast(" ")
else:
noperm(sender)
return True
@hook.event("server.ServerListPingEvent")
def onServerPing(event):
def on_server_ping(event):
event.setMotd(motd)