Skip to content

New script censor.py: censor messages for display#583

Merged
flashcode merged 1 commit into
weechat:mainfrom
dbohdan:censor
Jul 25, 2026
Merged

New script censor.py: censor messages for display#583
flashcode merged 1 commit into
weechat:mainfrom
dbohdan:censor

Conversation

@dbohdan

@dbohdan dbohdan commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

Script info

  • Script name: censor
  • Version: 0.3.0
  • Requirements
  • Min WeeChat version: 
  • Script tags: censor, ignore, regex

Description

This script provides an alternative to /ignore and to triggers that modify logs. It hides the contents of undesirable messages (detected by a regex on the nick or the message text) using color. The name comes from the censored look it gives messages. The script itself is simple and can be replaced with regex triggers. I think the value lies in the idea.

Checklist (new script)

  • Single commit, single file added
  • Commit message: New script name.py: short description…
  • No similar script already exists
  • Name: max 32 chars, only lower case letters, digits and underscores
  • Unique name, does not already exist in repository
  • No shebang on the first line
  • Comment in script with name/pseudo, e-mail and license using SPDX tags (see Contributing guide)
  • Only English in code/comments
  • Pure WeeChat API used, no extra API
  • Function hook_url, hook_process or hook_process_hashtable is used for any blocking call
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

Checklist (script update)

  • Author has been contacted
  • Single commit, single file added
  • Commit message format: script_name.py X.Y: …
  • Script version and Changelog have been updated
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

Checklist (script deletion)

  • Author has been contacted
  • Single commit, single file deleted
  • Commit message format: Remove script name.py with reasons in description

@flashcode flashcode self-assigned this Apr 19, 2026
@flashcode flashcode added feature New feature request new script New script and removed feature New feature request labels Apr 19, 2026
@flashcode

Copy link
Copy Markdown
Member

Hi @dbohdan,

Sorry for the long delay.

Could you please add options for CENSORED_NICKS, CENSORED_TEXT and CENSOR_COLOR, so that users don't have to edit the script by hand to configure it, but can use /set or /fset?

Thank you.

@flashcode flashcode added the waiting info Waiting for info from author of issue label Jul 25, 2026
@dbohdan

dbohdan commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Done. Adding configuration required me to change the pattern options from lists of regular expressions to single regular expressions, but that seems okay. You can combine ["foo+", "bar"] into (foo+|bar).

The updated version also has improved message-text matching and an optimized line hook. It suppresses highlights and notifications for censored messages. There are no new weechat-script-lint problems.

@flashcode
flashcode merged commit 6a30558 into weechat:main Jul 25, 2026
2 checks passed
@flashcode

Copy link
Copy Markdown
Member

Thanks, script added!

@flashcode flashcode removed the waiting info Waiting for info from author of issue label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new script New script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants