You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ben Harris e336fdb008 join channels and identify after RPL_WELCOME 1 year ago
.cfg.example add systemd unit and config file 2 years ago
.gitignore add nickserv support 1 year ago
LICENSE initial commit 7 years ago
README.md add nickserv support 1 year ago
account.ini.sample add nickserv support 1 year ago
sedbot.bash join channels and identify after RPL_WELCOME 1 year ago
sedbot.service add nickserv support 1 year ago

README.md

sedbot

forked from clsr/sedbot - updated for -i's new argument requirement and daemonized

sedbot is an IRC search-replace bot written using bash and sed.

usage

  1. cp .cfg{.example,}
  2. adjust as needed
  3. bash sedbot.bash

daemonization

  1. adjust sedbot.service
  2. mkdir -p ~/.config/systemd/user
  3. cp sedbot.service ~/.config/systemd/user/
  4. systemctl --user daemon-reload
  5. systemctl --user enable --now sedbot

authenticate to services

  1. cp account.ini{.sample,}
  2. fill in your credentials
  3. restart the bot (systemctl --user restart sedbot)

Only the s command and g and i flags are supported. Multiple regular expressions can be used at once, delimit them with spaces in between the flags and the s next one’s s command. The last one may omit the trailing / if it has no options.

Example usage in chat:

<foo> Hello ther!
<foo> s/ther/there
<sedbot> <foo> Hello there!

<foo> I'm programmign right now
<bar> foo: s/gn/ng/
<sedbot> <foo> I'm programming right now

<foo> abcdefghi
<foo> s/\(.\)./\u\1/g s/
<sedbot> <foo> ACEGi
<foo> s/[a-e]//g s/\(.\)\(.\)/\2\1
<sedbot> <foo> gfhi

Note that the bot uses the standard grep (POSIX) regular expressions, i.e. use .\+ and \(foo\)\? instead of .+ and (foo)? as you’d do in egrep or other regex engines. Backreferences are written like s/\(.\)/\1, where \1 matches the first capturing group. Read more about sed regular expressions.