removed camelcase, added more coding style to readme
This commit is contained in:
12
motd.py
12
motd.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user