• Write an IRC bot - where to start?

    From klu@klu@tilde.club to tilde.meta on Wed Apr 21 07:17:04 2021
    Hi I want to write a small IRC bot for tilde.chat, where should I start?

    - any framework recommendation?
    - suggestion on where and how to host the bot?

    Thanks!
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From xwindows@xwindows@tilde.club to tilde.meta on Wed Apr 21 19:55:09 2021
    Note that I'm not an IRCop, these are information I got from asking
    around then and there. So, be aware that they are not authoritative answers...

    On Wed, 21 Apr 2021, klu@tilde.club wrote:

    Hi I want to write a small IRC bot for tilde.chat, where should I start?

    Read Tilde.chat bot guidelines:

    <https://rfc.tildeverse.org/rfcs/2>

    Also, while the bot policy on Tilde.chat is you may connect your bot(s)
    to the network, subjected to the requirements on above guidelines;
    be aware that joining bot into individual existing _channel_
    is subjected to channel moderator's approval (certain exceptions exist [1]). Joining bot into #meta channel is also subjected to IRCops' approval
    and extra scrutiny.

    If you plan to get your hand dirty by implementing things on your own
    (or would like to gain understanding of full implication of each command
    you sent), you might want to read the IRC specifications. [2]

    - any framework recommendation?

    I'm not a framework aficionado, so I'm not exactly a right person
    to answer that; you might have to wait for suggestions from others.
    (I have an unfinished IRC bot in the work, which is written in Perl,
    and barely use any library)

    - suggestion on where and how to host the bot?

    You could host your Tilde.chat-connected IRC bot right in Tilde.club;
    although you have to make sure that your bot is not going to be a
    resource hog in processor time and/or memory usage, even when it got
    mildly abused. [3] (Also prefixing `nice -n 19` when you're running it
    might be a good idea too)

    Note that hosting bot directly in Tilde.club also means you can connect
    locally to Inspircd node there <irc://localhost:6667/> without having
    to deal with TLS; which may relieve you from using additional libraries
    and save you from certain troubleshooting depending on the tech used.
    Doing this also means that your bot(s) share your ident, which can avert
    them from certain ban problems.

    Downside of doing this, as I'm aware of, is when Tilde.club reboots.
    (It does not happen _that_ often, but it still does happen
    for time to time) When it happens, your bot would go down, and you
    would have to start it again manually. I'm not sure what is Tilde.club's
    policy on users' SystemD units; so I wouldn't suggest you to count on that.

    Another catch is your bot would be subjected to the usual Tilde.club
    firewall rules: no outgoing connections to weird, nonstandard ports,
    and no accepting other incoming connections from outside of the club.

    Regards,
    ~xwindows

    -----

    [1] The main exception is #bots, where bots may roam freely, and you may
    test them there as much as you like. Other exceptions are
    your own channels; this also includes channels that you made dedicated
    to your bot(s).

    [2] IRC specifications:

    - RFC 1459 (original IRC2 specification, 1993)
    <https://tools.ietf.org/html/rfc2810>

    - RFC 2810-2813 (IRC2, 2000 update)
    <https://tools.ietf.org/html/rfc2810>
    <https://tools.ietf.org/html/rfc2811>
    <https://tools.ietf.org/html/rfc2812>
    <https://tools.ietf.org/html/rfc2813>

    [3] Tilde.chat's servers have been configured with rate limiting [4];
    so the issue of "other users flooding you" might not be the main
    problem that you would need to worry about. (That is, unless you
    intend to leave your bot in the wrath of #chaos,
    a place that rate limit need not apply)

    In normal cases, you just have to make sure that users cannot
    send/do something that trigger bot into doing some runaway processing,
    or doing things that cause other security issues.

    [4] IIRC, the Tilde.chat's default limit is that a client (including bots)
    can send no more than 10 messages per 2 seconds; exceeding that would
    result in the server immediately disconnect that client.
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From xwindows@xwindows@tilde.club to tilde.meta on Wed Apr 21 20:09:11 2021
    I made a typo here, the link to 1993 IRC spec is incorrect:

    On Wed, 21 Apr 2021, xwindows wrote:

    [2] IRC specifications:

    - RFC 1459 (original IRC2 specification, 1993)
    <https://tools.ietf.org/html/rfc2810>

    The corrected one follows...

    [2] IRC specifications:

    - RFC 1459 (original IRC2 specification, 1993)
    <https://tools.ietf.org/html/rfc1459>

    Regards,
    ~xwindows
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From klu@klu@tilde.club to tilde.meta on Wed Apr 21 15:12:56 2021
    wow thanks for the great info and sharing your own experience! it's
    amazing we have a similar path - I previously read that RFC and wrote a
    minimal bot framework in shell and awk as proof of concept. I might be
    able to pit it to use now :)

    Also just want to know what folls are using to develop their non-trivial
    bots here. I can see at least the tildebot is using some framework in
    Python.

    On 2021-04-21, xwindows <xwindows@tilde.club> wrote:
    I made a typo here, the link to 1993 IRC spec is incorrect:

    On Wed, 21 Apr 2021, xwindows wrote:

    [2] IRC specifications:

    - RFC 1459 (original IRC2 specification, 1993)
    <https://tools.ietf.org/html/rfc2810>

    The corrected one follows...

    [2] IRC specifications:

    - RFC 1459 (original IRC2 specification, 1993)
    <https://tools.ietf.org/html/rfc1459>

    Regards,
    ~xwindows
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From James Tomasino@tomasino@cosmic.voyage to tilde.meta on Wed Apr 21 16:47:56 2021
    On 2021-04-21, klu@tilde.club <klu@tilde.club> wrote:
    Also just want to know what folls are using to develop their non-trivial
    bots here. I can see at least the tildebot is using some framework in
    Python.

    Tildebot is a renamed bitbot, a project managed by jess. Here's the
    source. You can also find active discussion in #bitbot on freenode.

    https://github.com/jesopo/bitbot
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From klu@klu@tilde.club to tilde.meta on Wed Apr 21 18:03:30 2021
    On 2021-04-21, James Tomasino <tomasino@cosmic.voyage> wrote:
    On 2021-04-21, klu@tilde.club <klu@tilde.club> wrote:
    Also just want to know what folls are using to develop their non-trivial
    bots here. I can see at least the tildebot is using some framework in
    Python.

    Tildebot is a renamed bitbot, a project managed by jess. Here's the
    source. You can also find active discussion in #bitbot on freenode.

    https://github.com/jesopo/bitbot

    Thanks for the pointer James!
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From Alex Schroeder@alex@alexschroeder.ch to tilde.meta on Thu Jun 1 06:52:21 2023
    klu@tilde.club wrote:
    Hi I want to write a small IRC bot for tilde.chat, where should I start?

    A while ago I wrote a bot for both Discord and IRC in Perl.
    In case somebody stumbles into this old thread: https://alexschroeder.ch/cgit/norn/about/

    The README is in German but with some DeepL translation
    (or some German classes, I guess), it'll work. Feel free
    to ask questions by mail, too.

    Alex
    --
    I apologize for all the bad signatures I used in the past.
    --- Synchronet 3.19a-Linux NewsLink 1.113
  • From James Tomasino@tomasino@cosmic.voyage to tilde.meta on Thu Jun 1 16:12:10 2023
    On 2023-06-01, Alex Schroeder <alex@alexschroeder.ch> wrote:
    klu@tilde.club wrote:
    Hi I want to write a small IRC bot for tilde.chat, where should I start?

    A while ago I wrote a bot for both Discord and IRC in Perl.
    In case somebody stumbles into this old thread: https://alexschroeder.ch/cgit/norn/about/

    Oh nice! I believe khuxkm also has a irc bot starter in python over
    here:
    https://tildegit.org/team/teambot
    --- Synchronet 3.19a-Linux NewsLink 1.113