filter.help='/filter <words> - Add to the list of words that users will be kicked upon for saying. This feature requires the bot to have administrative permissions. The kick will only be a soft-ban (meaning the targeted user is able to return to the chat immediately), unless the "Ban Not Kick" setting is enabled in the /administration menu.'
'You may only have 200 words filtered at a time. There are currently '..tostring(#total)..' word(s) filtered in this chat, so you may only add up to '..tostring(remaining)..' more.'
)
end
localnew={}
forn,wordinpairs(words)
do
ifnotredis:sismember(
'word_filter:'..message.chat.id,
word
)
then
localsuccess=redis:sadd(
'word_filter:'..message.chat.id,
word
)
ifsuccess
then
table.insert(
new,
word
)
end
end
end
returnmattata.send_message(
message.chat.id,
tostring(#new)..' word(s) have been added to this chat\'s word filter. Use /unfilter <words> to remove words from this filter.'