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

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

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

by sofar » Sun Feb 18, 2018 20:50

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/archive/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/055a74d8d717a41e5a937cc54a7322e5

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/blob/master/readme.md
 

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

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

by rubenwardy » Sun Feb 18, 2018 21:01

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 » Thu Mar 08, 2018 00:10

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: 5544
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

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

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

by Mineminer » Thu Mar 08, 2018 00:21

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: 5544
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

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

by rubenwardy » Thu Mar 08, 2018 00:23

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 » Thu Mar 08, 2018 00:32

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 » Fri Apr 20, 2018 11:36

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: 1980
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 2 guests