Files
anti-spam.sk
Code
1 115
anti-spam.sk
# ==========================================
# TITAN MC - ANTI SPAM & ANTI ADVERTISING
# ==========================================
options:
prefix: &c&lCHAT &8» &c
cooldown: 2 seconds
# ------------------------------------------
# CHAT SPAM, REPEATED MESSAGES & FILTERS
# ------------------------------------------
on chat:
set {_uuid} to player's uuid
set {_msg} to lowercase message
# Chat cooldown
if {chat.cooldown.%{_uuid}%} is set:
if difference between now and {chat.cooldown.%{_uuid}%} < {@cooldown}:
cancel event
send "{@prefix}Please don't spam the chat!" to player
stop
# Repeated message check
if {chat.last-message.%{_uuid}%} is {_msg}:
cancel event
send "{@prefix}Don't repeat the same message!" to player
stop
# Block web links
if {_msg} contains "http://":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains "https://":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains "www.":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains ".com":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains ".net":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains ".org":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
if {_msg} contains ".gg":
cancel event
send "{@prefix}Links are not allowed in chat!" to player
stop
# Block Discord invites
if {_msg} contains "discord.gg":
cancel event
send "{@prefix}Discord links are not allowed!" to player
stop
if {_msg} contains "discord.com/invite":
cancel event
send "{@prefix}Discord links are not allowed!" to player
stop
# Block Minecraft server advertising
if {_msg} contains "play.":
cancel event
send "{@prefix}Server IP advertising is not allowed!" to player
stop
if {_msg} contains "mc.":
cancel event
send "{@prefix}Server IP advertising is not allowed!" to player
stop
if {_msg} contains "server.":
cancel event
send "{@prefix}Server IP advertising is not allowed!" to player
stop
if {_msg} contains ":25565":
cancel event
send "{@prefix}Server IP advertising is not allowed!" to player
stop
# Block repeated character spam
if {_msg} contains "!!!!!!!!":
cancel event
send "{@prefix}Please don't spam characters!" to player
stop
if {_msg} contains "????????":
cancel event
send "{@prefix}Please don't spam characters!" to player
stop
if {_msg} contains "........":
cancel event
send "{@prefix}Please don't spam characters!" to player
stop
set {chat.cooldown.%{_uuid}%} to now
set {chat.last-message.%{_uuid}%} to {_msg}