[Mod] filter [filter] - filter out words from chat

Post Reply
sofar
Developer
Posts: 2128
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

[Mod] filter [filter] - filter out words from chat

by sofar » Post

The filter mod adds a simple word-based chat filter. Meant for servers, this mod will allow admins to have a simple way to tell players to keep chat free of certain expressions without being overly dramatic about it. As well as normal chat, this mod also automatically supports any chat commands which require shout.

The mod supports the following actions on players who violate a rule:
  • Warning formspec - informs the user that bad language is not permitted (first violation in rolling period)
  • Mute for a minute (on second or third violation)
  • Kick player (on fourth violation)
License: MIT
Optional Dependencies: rules, email
Authors: rubenwardy, sofar
Project URL: https://github.com/minetest-mods/filter
Latest release: https://github.com/minetest-mods/filter ... master.zip

Image

Chat commands

Code: Select all

/filter add <word> -- add word to the word list
/filter remove <word> -- remove a word from the word list
/filter list -- list the words stored.
Word lists

Filling the word list for the first time can be done by placing a words.txt file into the mod's folder. An example of such a words.txt can be found here: https://gist.github.com/rubenwardy/055a ... c54a7322e5

API

The filter mod exports a simple API that allows other mods to receive notifications of events related to the filter mod, or use the muting functionality of the filter mod. For a fill list, check out the readme file in the filter mod:
https://github.com/minetest-mods/filter ... /readme.md

User avatar
rubenwardy
Moderator
Posts: 6087
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] filter [filter] - filter out words from chat

by rubenwardy » Post

For me, this mod isn't to stop swearing completely. It's to let players know that swearing isn't allowed. If all players know this, then there is no excuse for players swearing. This reduces the amount of swearing massively

I use the following code on CTF to damage swearing players:

Code: Select all

filter.register_on_violation(function(name, message, total_violations, violations)
	local player = minetest.get_player_by_name(name)
	if player then
		local hp = player:get_hp()
		if hp > 3*2 then
			hp = hp - 3*2
		else
			hp = 1
		end
		player:set_hp(hp)
	end
end)

Mineminer
Member
Posts: 58
Joined: Mon Mar 05, 2018 04:05

Re: [Mod] filter [filter] - filter out words from chat

by Mineminer » Post

This is neat, but I am little confused...
Dependencies: rules(optional), email(optional)


Is it me or is finding these difficult on this forum? Also how do I dictate punishments and do they persists? Or can they have "cool downs" (say after 120 secs one goes and etc)?

Thanks in advance!

User avatar
rubenwardy
Moderator
Posts: 6087
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] filter [filter] - filter out words from chat

by rubenwardy » Post

I haven't made rules public yet, sorry. Forgot
Email is here: viewtopic.php?t=13754

Mineminer
Member
Posts: 58
Joined: Mon Mar 05, 2018 04:05

Re: [Mod] filter [filter] - filter out words from chat

by Mineminer » Post

rubenwardy wrote:I haven't made rules public yet, sorry. Forgot
Email is here: viewtopic.php?t=13754


Ahh I see, so for now it will "warn" upon "violations" until such is later released?

User avatar
rubenwardy
Moderator
Posts: 6087
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] filter [filter] - filter out words from chat

by rubenwardy » Post

The mods works on a roughly 10 minute average. If they've not sweared in the last 10 minutes, they'll be warned. If they swear again, they'll be muted. If they swear again, they'll be kicked.

Mineminer
Member
Posts: 58
Joined: Mon Mar 05, 2018 04:05

Re: [Mod] filter [filter] - filter out words from chat

by Mineminer » Post

rubenwardy wrote:The mods works on a roughly 10 minute average. If they've not sweared in the last 10 minutes, they'll be warned. If they swear again, they'll be muted. If they swear again, they'll be kicked.


Ahh I see that make sense, thanks for the details.

Dan2018
Member
Posts: 26
Joined: Mon Mar 12, 2018 15:07

Re: [Mod] filter [filter] - filter out words from chat

by Dan2018 » Post

Ignore this, accidentally hit another key causing issues, Was no clipping and couldnt work it out.

Yet to try it out with a second user but so far its given me warnings.

User avatar
Lone_Wolf
Member
Posts: 2326
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] filter [filter] - filter out words from chat

by Lone_Wolf » Post

This is just what I was looking for. Thanks!

User avatar
bosapara
Member
Posts: 574
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [Mod] filter [filter] - filter out words from chat

by bosapara » Post

Thanx for mod. Found some bug. Mod can't detect words with cyrillic symbols.

PS At 'chat_anticurse' mod detect cyrillic words correctly

Post Reply

Who is online

Users browsing this forum: Lemente and 4 guests