.BANCHO. Add PM templates for mods and admins
This commit is contained in:
parent
7eeb5c4ef5
commit
97d81696b1
3
messageTemplates.py
Normal file
3
messageTemplates.py
Normal file
|
@ -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."
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import serverPackets
|
||||||
import glob
|
import glob
|
||||||
import fokabot
|
import fokabot
|
||||||
import exceptions
|
import exceptions
|
||||||
|
import messageTemplates
|
||||||
|
|
||||||
def handle(userToken, packetData):
|
def handle(userToken, packetData):
|
||||||
"""
|
"""
|
||||||
|
@ -33,6 +34,10 @@ def handle(userToken, packetData):
|
||||||
if token == None:
|
if token == None:
|
||||||
raise exceptions.tokenNotFoundException()
|
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
|
# Send message to target
|
||||||
token.enqueue(serverPackets.sendMessage(username, packetData["to"], packetData["message"]))
|
token.enqueue(serverPackets.sendMessage(username, packetData["to"], packetData["message"]))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user