blob: 915fa63ab201d09840c062618a9bdc0654270dd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)
|