{"id":16651813,"url":"https://github.com/henry232323/elixirc","last_synced_at":"2026-04-21T18:02:10.173Z","repository":{"id":57494484,"uuid":"93214640","full_name":"henry232323/elixirc","owner":"henry232323","description":"A small lightweight Elixir IRC library","archived":false,"fork":false,"pushed_at":"2017-07-30T00:11:13.000Z","size":338,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-15T06:20:15.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/henry232323.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2017-06-03T01:05:41.000Z","updated_at":"2024-03-15T06:20:15.548Z","dependencies_parsed_at":"2022-09-02T20:22:40.405Z","dependency_job_id":null,"html_url":"https://github.com/henry232323/elixirc","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/henry232323%2Felixirc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry232323%2Felixirc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry232323%2Felixirc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry232323%2Felixirc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henry232323","download_url":"https://codeload.github.com/henry232323/elixirc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243248103,"owners_count":20260748,"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":[],"created_at":"2024-10-12T09:26:40.278Z","updated_at":"2025-12-11T18:20:33.265Z","avatar_url":"https://github.com/henry232323.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elixirc\n[![Build Status](https://travis-ci.org/henry232323/elixirc.svg?branch=master)](https://travis-ci.org/henry232323/elixirc)\n[![Hex.pm Version](http://img.shields.io/hexpm/v/exirc.svg?style=flat)](https://hex.pm/packages/elixirc)\n\u003cbr /\u003e\nA small lightweight Elixir IRC library based off the Python IRC library [aioyoyo](https://github.com/henry232323/aioyoyo)/oyoyo. Available on Hex.\n\n# Example usage\n```elixir\ndefmodule ElixircTest do\n  use Supervisor\n  import Supervisor.Spec\n\n  def start(_type, _args) do\n    state = %Elixirc.State{address: 'chat.freenode.net',\n                           port: 6667,\n                           ssl: false,\n                           nick: \"henry232323\",\n                           name: \"henry232323\",\n                           pinging: true}\n    Elixirc.start!(state)\n    Supervisor.start_link(__MODULE__, state, name: __MODULE__)\n  end\n\n  def init(:ok) do\n    children = [\n      worker(TestConsumer, [:ok])\n    ]\n    supervise(children, strategy: :one_for_one)\n  end\nend\n\ndefmodule TestConsumer do\n  use Elixirc.Consumer\n  alias Elixirc.Client\n\n  def start_link(:ok) do\n    Elixirc.Consumer.start_link(__MODULE__, :ok)\n  end\n\n  def handle_command(:welcome, [message], state) do\n    Client.send([\"JOIN\", \"#elixir-lang\"])\n    IO.inspect(\"We've been welcomed with the following message: #{message}\")\n    {:ok, state}\n  end\n\n  def handle_command(_command, _args, state) do\n    {:ok, state}\n  end\n\n  def handle_event(:send, {request}, state) do\n    IO.puts(\"Sent message #{request}\")\n    {:ok, state}\n  end\n\n  def handle_event(_event, _args, state) do\n    {:ok, state}\n  end\nend\n```\n# State\nCommands will pass the client state. This is the default state. Whatever state you\n pass should have at least these keys.\n```elixir\ndefmodule Elixirc.State do\n  defstruct address: \"\",\n            port: \"\",\n            ssl: false,\n            nick: \"\",\n            name: \"\",\n            pass: \"\",\n            pinging: false,\n            reconnect: false,\n            channels: {},\n            users: %{},\n            socket: nil,\n            state: %{} # sub state\nend\n```\n   - Pinging:   If this is enabled the client will automatically handle PINGs for you\n   - Reconnect: If this is enabled the client will reconnect upon a closed connection by the server\n   - SSL:       If this is enabled the client will connect via SSL\n   - Socket:    This is the socket that the client will read from, this is automatically overwritten\n   - State:     A simple 'sub-state' available within the Client's state, can be modified without breaking anything\n   - Address:   The server address\n   - Port:      The server port\n   - Channels:  The channel list\n   - Users:     The user list\n   - Nick:      The nick that will be used\n   - Name:      The name that will be used\n   - Pass:      The password that will be used with SASL/NickServ\n\n# Handle Commands\n  `handle_command/3` will be called with every message sent from the server. As shown\n  in the above examples it will be called first with an atom representing the command\n  (usually in all caps in the message as the first argument, or if a numeric command\n  is preceded by a prefix) then a list of its arguments, and finally the current state\n  as defined above.\n\n  A list of numeric events can be found [here](https://www.alien.net.au/irc/irc2numerics.html)\n  The commands used by the client can be found in the [source](https://github.com/henry232323/elixirc/blob/master/lib/elixirc/events.ex)\n  (A little long to be listed here) or accessed as `Elixirc.Events.events`\n\n# Handle Event\n  `handle_event/3` will be called with every action on the part of the client and certain\n  other events. It operates in the same fashion as `handle_command/3` with the first\n  argument being the event, the second being a tuple of its arguments and the third\n  being the state. Valid events currently include:\n\n    - :socket_closed    {reason}    The socket was closed for some reason\n    - :close            {}          The client/socket have been closed by user\n    - :send             {message}   A message has been sent to the server\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry232323%2Felixirc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenry232323%2Felixirc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry232323%2Felixirc/lists"}