Skip to content

A WeeChat script to intercept and format messages from a bridge bot

Notifications You must be signed in to change notification settings

Gbury/format_bridge_bot_output

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Fork of format_bridge_bot_output

This is a fork of the format_bridge_out_bot_output weechat script

Original README

Intercepts messages before WeeChat displays them and if found to have been sent by a bridge bot proceeds to alter the message so that when displayed it has the appearance of being sent by a native IRC user.

I (ndlr: the author of the original repository) wrote a blog post to accompany this script when I first released it in November 2018: WeeChat IRC Client - Formatting Bridge Bot Output

Using this for the #ocaml discord bot

Downlaod the script:

wget -O ~/.weechat/python/format_bridge_bot_output.py \
  https://raw.githubusercontent.com/Gbury/format_bridge_bot_output/master/format_bridge_bot_output/format_bridge_bot_output.py

(Optional) Link it for auto-loading:

cd ~/.weechat/python/autoload && ln -s ../format_bridge_bot_output.py

Load the script in weechat:

/script load format_bridge_bot_output.py

In weechat, setup the script for your desired channel:

/format_bridge_bot_output_add-server-channel-botnicks-nicklength <group_name> <server_name> <channel_name> <bot_name> <max_nick_length>
/format_bridge_bot_output_add-regex <group_name> <regexp>

Note that <group_name> is an arbitrary name you can choose to refer to the configuration of the script for the particular combination of server, channel, and bot name.

For instance, on my setup, the commands looked like:

/format_bridge_bot_output_add-server-channel-botnicks-nicklength ocamldiscord libera #ocaml d_bot 15
/format_bridge_bot_output_add-regex ocamldiscord (?P<action>(?:^[\x01]ACTION |^))<(?P<nick>.+?)> (?P<text>.*)

Note

Fomr what I can tell, this script may not interact as well as desired with other scripts, but the main limitation I saw up to now is that nicks in rewritten messages are not colorized, which is sad, but in my opinion still better than not rewriting the messages.

About

A WeeChat script to intercept and format messages from a bridge bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%