diff --git a/messageTemplates.py b/messageTemplates.py new file mode 100644 index 0000000..25e4844 --- /dev/null +++ b/messageTemplates.py @@ -0,0 +1,3 @@ +templates = { + "!name": "You can't have that name. It goes against the [https://ripple.moe/index.php?p=23 Ripple Rules] (section \"General Rules\", \"Use an appropriate username (no offensive or *stolen* names)\"). Please tell us an appropriate (NOT STOLEN) username you'd like to have. If you ignore this message you will be banned in 3 minutes. If you fuck with us claiming repeatedly to be the person you're impersonificating without any real proof or keeping on asking to use inappropriate usernames, you'll also get banned." +} diff --git a/sendPrivateMessageEvent.py b/sendPrivateMessageEvent.py index d2056df..3b23a38 100644 --- a/sendPrivateMessageEvent.py +++ b/sendPrivateMessageEvent.py @@ -5,6 +5,7 @@ import serverPackets import glob import fokabot import exceptions +import messageTemplates def handle(userToken, packetData): """ @@ -33,6 +34,10 @@ def handle(userToken, packetData): if token == None: raise exceptions.tokenNotFoundException() + # Check message templates (mods/admins only) + if packetData["message"] in messageTemplates.templates and userToken.rank >= 3: + packetData["message"] = messageTemplates.templates[packetData["message"]] + # Send message to target token.enqueue(serverPackets.sendMessage(username, packetData["to"], packetData["message"]))