{"id":21068498,"url":"https://github.com/matheusfillipe/irc_bash_bot","last_synced_at":"2026-04-21T21:34:30.810Z","repository":{"id":101329846,"uuid":"409488635","full_name":"matheusfillipe/irc_bash_bot","owner":"matheusfillipe","description":"Proof of concept irc bot starting point","archived":false,"fork":false,"pushed_at":"2021-11-03T07:33:55.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T21:37:48.675Z","etag":null,"topics":["bash","bot","irc","shell-s"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matheusfillipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-09-23T07:17:54.000Z","updated_at":"2021-11-03T07:33:57.000Z","dependencies_parsed_at":"2023-09-21T16:55:27.613Z","dependency_job_id":null,"html_url":"https://github.com/matheusfillipe/irc_bash_bot","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/matheusfillipe%2Firc_bash_bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusfillipe%2Firc_bash_bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusfillipe%2Firc_bash_bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheusfillipe%2Firc_bash_bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matheusfillipe","download_url":"https://codeload.github.com/matheusfillipe/irc_bash_bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243510056,"owners_count":20302296,"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":["bash","bot","irc","shell-s"],"created_at":"2024-11-19T18:22:19.645Z","updated_at":"2025-12-29T21:40:07.773Z","avatar_url":"https://github.com/matheusfillipe.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Irc Bash bot\nA simple to add commands, irc bot written fully in bash using netcat for handling the connection. This is a proof of concept and might have security flaws.\n\n# Usage \n## Installation\n\nInstall netcat and make sure you have the `-v` and `-c` options enabled on it. On some distros this is called `ncat`:\n\n``` sh\nsudo apt install ncat\n```\n\nEdit `config.sh` with your bot's nickname, irc hort, port, and optionally the netcat command. \n\n    - NC_COMMAND: Netcat command. Usually ncat is fine.\n    - HOST: Irc server hostname\n    - PORT: Irc server port\n    - NAME: Nickname and Username of the irc bot\n    - CHAN: Channel the bot will join (it will join any other channel when it receives invitation)\n    - PREF: Prefix the bot commands should begin with. Usually something like '!', '=', '$', '@' etc...\n    - PING: Ping period in seconds. 10 is usually fine.\n    \n## Defining new commands\n\nAnything inside the `commands` folder without extension or with the extension `.sh` will be a bot command, matching the file name. It does not need execution permissions. \n\nFor example, create a shell script named `command.sh` inside the `commands` folder. You can now run `=command argument1 argument2` on your bot (without having to restart it even!). Inside `command.sh` you can address \"argument1\" with `$1` and \"argument2\" with `$2`. Whatever this script's stdout is it's returned to the irc channel the command was called from. You can send multiple lines.\n\n## Read channel and nickname\n\nChannel and nickname information are relayed by stdin. Basically `\"$channel $nick\"` (notice the space in between) is piped to every command script. Check out echo.sh to know how to handle this. Also notice that if you are creating commands by simply copying or symlinking existing commands into `commands/` and this command reads stin you will probably get some undesired behaviour, so always create a script yourself inside `commands/` and call whatever you want like `some_command $@`.\n\nExample:\n```shell\ninfo=\"$(cat -)\" # read piped stdin\nchannel=$(echo \"$info\" | cut -d\\  -f1) \nnick=$(echo \"$info\" | cut -d\\  -f2) \n```\n\n## Use other common irc commands\n\nIf your command script has a line starting with \"/\" on its stdout it will be read as an irc command like on most irc clients. Only a few commands are currently implemented like `/nick` `/msg` (for private or channel messages, like sending to another channel), `/join`, `/mode` etc.... These commands are case insensitive.\n\nExample:\n```shell\nnick=$(cat - | cut -d\\  -f2) \ncase \"$1\" in\n  \"join\")\n    echo \"/join $2\"\n  ;;\n  \"nick\")\n    echo \"/nick $2\"\n  ;;\n  \"msg\")\n    echo \"/msg $2 ${@:3}\"\n  ;;\n  \"help\")\n    echo \"$nick: you can use join, nick and msg to do whatever you want with me ;)\"\n  ;;\nesac\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheusfillipe%2Firc_bash_bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheusfillipe%2Firc_bash_bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheusfillipe%2Firc_bash_bot/lists"}