critter
Chat bot relaying messages between IRC and Gitter
Requires Crystal 0.34 or later to compile.
Check it out: on Gitter / #critterbot on Libera.Chat
The messages are sent from one nickname – a special bot account, both on IRC and Gitter. It looks like this:
-
Gitter:
Oleh Prypin @BlaXpirit 23:25
Writing from GitterBridge bot @bot 23:27
<BlaXpirit> Writing from IRC -
IRC:
[23:25] <bot> <BlaXpirit> Writing from Gitter
[23:27] <BlaXpirit> Writing from IRC
The bot replies to mentions and private messages, giving information about itself. It does not respond to !commands
of any sort.
Long/multiline messages (primarily code pastes) from Gitter are collapsed when sending to IRC, but a link to the original message is provided.
Usage example:
critter \
--irc-host=irc.libera.chat --irc-port=6697 --irc-ssl=yes --irc-nick=FromGitter \
--irc-password='Pa$$word' --gitter-api-key=da39a3ee5e6b4b0d3255bfef95601890afd80709 \
--contact-info="Contact ... on Libera.Chat or email bridge@example.org for support" \
--irc-channel=##my-channel --gitter-room=CoolDude/testing \; \
--irc-channel=#cool-thing --gitter-room=CoolOrg/thing
Full list of supported options
The program accepts only named options, and they must be in the form option=value
(dashes optional, spaces and alternative forms --option value
forbidden). Normally it bridges only 1 IRC channel with 1 Gitter room but multiple configurations can be supplied: if there is an argument which is a semicolon ;
by itself, it ends one set of options and starts another. Options that are the same as in the previous set don't need to be specified. So the example above bridges ##my-channel with CoolDude/testing, and completely separately #cool-thing with CoolOrg/thing, which is comparable to just running two separate instances of the program, except then they wouldn't be able to have the same nickname on the same IRC server.
It is not possible to bridge e.g. two IRC channels with this CLI but editing the program to do so is not difficult.
You should sign up for a separate GitHub account for the bot, then sign into Gitter based on it and get an API key. It helps being creative with the bot's nickname, e.g. FromIRC and FromGitter, so the intent is clear.
critter
- 16
- 3
- 0
- 0
- 1
- about 2 years ago
- June 11, 2016
MIT License
Sun, 22 Dec 2024 06:37:25 GMT