monk-afk / filterplus

Chat filter and censor for Minetest. Includes mute command, player tags, and mention highlight.
MIT License
1 stars 0 forks source link
censor chat filter lua minetest minetest-mod multicraft

FilterPlus

Primarily a chat filter, also censors content via API.

Copyright (c) 2023 monk

ContentDB

Details

Chat commands

Block

This command checks for staff priv and prevents staff ranked players from blocking and being blocked.

Stop incoming messages from a player, and outgoing messages from being seen by player. Also blocks private messages from blocked players. The block is enforced until the internally managed online players table purges the player who issued the block from the online players list, approx. 1 hour after they log out.

/block <player_name>

/unblock <player_name>

/unblock <> (empty argument)

/unblock <*>

Mute

Disables a player from using public chat, does not mute private messaging. Applied to players by IP address, so any players currently online or alt accounts to join will be muted until the time expires. Can be used on offline players if they were online recently (approx 1 hour).

/mute <playername> [<minutes>]

/unmute <playername>

Filter List management

/filter <blacklist>|<whitelist>|<delete>|<search> <string>

/filter whitelist word

/filter blacklist word

/filter delete word

/filter search word

/filter_save <whitelist>|<blacklist>

/filter_reload <mod_storage>|<file>

Private Message

Overrides the default /msg command to allow blocking private messages. Additionally, a "to: <player>" message shows in the sender's chat when a private message is sent.

Message Tags

Player nametag in chat default format is: <PlayerName>.

Supported tags from mods if available: Ranks, Factions, Exp.

The minetest.conf setting must be true, and pass required values.

Tag order is: {Rank}[Faction](Exp)<PlayerName> message

API

Not limited to chat messages. Strings from any mod can be checked against filter api:

filterplus_api.check_word(string)

This will return with the string, censored or not, with boolean:

return "This **** is censored", true

return "This word is not censored", false

Additional Info

Filter lists are sorted by numerical index, not alphabetically. This allows for word priority when list checking, for example, if luck and luk are blacklisted, saying lucky will catch the former first.

If tex is a blacklisted word, all instances containing tex are filtered, such as text, context, contextual, etc. This means blacklisting these branch words is redundant, root words should be sufficient.

Current Version 0.1.5