-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speech filter #1082
Speech filter #1082
Conversation
Reviewer's Guide by SourceryThis pull request implements a speech filter that replaces certain words with "цветочек". It also adds a configuration option to enable/disable the filter and a list of ckeys that can bypass the filter. Sequence diagram for speech filtering processsequenceDiagram
participant User as User
participant Mob as Mob
participant Filter as SpeechFilter
participant Config as Config
User->>Mob: Say message
activate Mob
Mob->>Filter: filter_speech()
activate Filter
Filter->>Config: Check if filter enabled
Config-->>Filter: Filter status
alt filter enabled
Filter->>Filter: Check bypass list
alt user not in bypass list
Filter->>Filter: Apply regex filter
Filter-->>Mob: Return filtered message
Filter->>User: Show warning message
Filter->>Admin: Log filtered message
else user in bypass list
Filter-->>Mob: Return original message
end
else filter disabled
Filter-->>Mob: Return original message
end
deactivate Filter
Mob-->>User: Display message
deactivate Mob
Class diagram for speech filter implementationclassDiagram
class SpeechFilter {
<<element>>
-brainrot_notifications: list
+Attach(target)
+Detach(source, force)
-filter_speech(talker, speech_args)
-get_brainrot_filter_regex()
-can_bypass_filter(mob_to_check)
}
class ConfigEntry {
<<class>>
+enable_speech_filter: flag
+speech_filter_bypass: str_list
}
class Mob {
+Login()
}
Mob ..> SpeechFilter : uses
SpeechFilter ..> ConfigEntry : reads
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне больше нечего добавить
Co-authored-by: dj-34 <dj-34@bk.ru>
## If enabled, some words will be removed from player's messages. | ||
# ENABLE_SPEECH_FILTER | ||
## List of ckeys, that bypass speech filter. | ||
# SPEECH_FILTER_BYPASS ckey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У нас на паре так реализовано? Почему не отдельный файл...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На паре основной конфиг в .toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно было добавить еще один ключ в brainrot_filter.json
, но не думаю, что много кому надо обходить фильтр, максимум самим стримерам
Получаешь ли ты ещё дебаф к настроению? |
Нет |
Что этот PR делает
Добавляет фильтр речи. Портирует ss220club/Paradise-SS220#1225
Closes #1078
Почему это хорошо для игры
Меньше нарушения атмосферы, меньше банов за слово на букву П
Тестирование
Локальные тесты
Changelog
🆑
add: Добавлен фильтр речи
server: Добавлено включение фильтра и список сикеев, которые его обходят в конфиге. Добавлен .json с фильтрами
/:cl:
Summary by Sourcery
Add a speech filter that censors specific words and phrases. The filter is configurable and can be bypassed by specific users.
New Features:
Tests: