{"id":24186733,"url":"https://github.com/fridim/cabot","last_synced_at":"2025-09-21T10:31:52.656Z","repository":{"id":120111258,"uuid":"75711507","full_name":"fridim/cabot","owner":"fridim","description":"a simple IRC framework written in whatever you want","archived":false,"fork":false,"pushed_at":"2025-01-12T11:35:27.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-12T12:30:49.991Z","etag":null,"topics":["bot","bot-framework","golang","irc","irc-bot"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fridim.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-06T08:36:56.000Z","updated_at":"2025-01-12T11:35:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e22cb63-32b3-4882-b4b1-b9d1096a2338","html_url":"https://github.com/fridim/cabot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridim%2Fcabot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridim%2Fcabot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridim%2Fcabot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fridim%2Fcabot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fridim","download_url":"https://codeload.github.com/fridim/cabot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233742575,"owners_count":18723086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","bot-framework","golang","irc","irc-bot"],"created_at":"2025-01-13T12:36:42.548Z","updated_at":"2025-09-21T10:31:47.261Z","avatar_url":"https://github.com/fridim.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: cabot, a simple IRC framework written in whatever you want\n#+AUTHOR: Guillaume Coré (fridim) \u003cfridim@onfi.re\u003e\n\n* About\n\nThis is a minimalist IRC bot written in Go as an exercice to learn the language. The core codebase (in Go) has very few features :\n\n- connect to a server\n- plugins:\n  - run all executable files located in =plugins/=\n  - dispatch input to all plugins located in the =plugins/= directory\n  - Example output of =ps=\n\n#+BEGIN_SRC\n3551 pts/2    Sl+    0:00  \\_ ./bot -server=irc.freenode.org:6667\n3558 pts/2    Sl+    0:00      \\_ /usr/bin/ruby plugins/register_and_join.rb\n3561 pts/2    Sl+    0:00      \\_ /usr/bin/ruby plugins/url.rb\n3566 pts/2    Sl+    0:00      \\_ /usr/bin/ruby plugins/date.rb\n3577 pts/2    Sl+    0:00      \\_ /usr/bin/ruby plugins/hello.rb\n3579 pts/2    Sl+    0:00      \\_ plugins/ping\n#+END_SRC\n\n- signals:\n  - =SIGHUP= will kill and reload all plugins\n  - =SIGUSR1= to reconnect\n\nI have absolutely no credit, as this program is a clone of vivien's [[https://github.com/vivien/modulo][modulo]]. Have a look there!\n\n\n** Plugins\n\nEverything other than the previous is done via plugins.\nPlugins are scripts or compiled programs in the =plugins/= directory.\n\nA plugin must:\n\n- be executable\n- read from STDIN\n- write to STDOUT\n\nExample of plugins:\n- [[file:plugins_examples/ping/ping.go][ping.go]]: reply to PONG from server and send =SIGUSR1= to parent process if last pong is too old\n- [[file:plugins_examples/freenode_register_join.rb][freenode_register_join.rb]]: register USER and NICK and JOIN channels\n- reload plugins from IRC by just talking to your bot, plugin will SIGHUP the parent process on a specific input from registered owner.\n- whatever you want, really\n\n\nInput from the IRC Socket is directly rewritten to the plugin STDIN. The STDOUT of the plugin is then pipelined back to the IRC socket. It's that simple.\n\nExample of helloworld in Ruby:\n\n#+BEGIN_SRC ruby\n#!/usr/bin/ruby\nSTDOUT.sync = true\n\nSTDIN.each_line do |l|\n  if l =~ /PRIVMSG (#\\w+) :(.+)/\n    channel = $1\n    message = $2\n    if message =~ /^hello/i\n      puts \"PRIVMSG #{channel} :Hello o/\"\n    end\n  end\nend\n#+END_SRC\n\nDo not forget to sync the STDOUT in your plugin otherwise, the bot will probably not reply when you imagine it would.\n\n\n* Getting started\n\n** Build\n\n#+BEGIN_SRC\n$ go build *.go\n#+END_SRC\n\nYou will also need the ping plugin\n\n#+BEGIN_SRC\n$ cd plugins_examples/ping\n$ go build ping.go\n$ cp ping ../../plugins/\n#+END_SRC\n\n** Minimal configuration\n\nEverything related to IRC will be dealt with by plugins.\n\nYou will find examples of plugin in plugins_examples/ directory. For freenode, you can just edit =plugins_examples/freenode_register_join.rb= and set channels to join and Nickserv password in a file.\n\n** Run\n\n#+BEGIN_SRC\n$ ./bot -server=chat.freenode.net:6697 -ssl\n#+END_SRC\n\n* Install dependencies\n\n** Alpine\n\n#+BEGIN_SRC\napk add git go ruby-dev perl python3 py3-pip perl-libwww\ngem install tzinfo\ngem install io-console\ngem install etc\npip install googletrans\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffridim%2Fcabot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffridim%2Fcabot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffridim%2Fcabot/lists"}