{"id":15672913,"url":"https://github.com/willrax/marvin","last_synced_at":"2025-05-06T22:07:42.638Z","repository":{"id":57521282,"uuid":"48658821","full_name":"willrax/marvin","owner":"willrax","description":":space_invader: Slack bots using Elixir.","archived":false,"fork":false,"pushed_at":"2016-09-04T08:10:42.000Z","size":30,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-06T22:07:39.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hexdocs.pm/marvin/","language":"Elixir","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/willrax.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}},"created_at":"2015-12-27T20:09:57.000Z","updated_at":"2023-03-08T16:42:37.000Z","dependencies_parsed_at":"2022-09-26T18:01:13.797Z","dependency_job_id":null,"html_url":"https://github.com/willrax/marvin","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmarvin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmarvin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmarvin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmarvin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willrax","download_url":"https://codeload.github.com/willrax/marvin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776581,"owners_count":21802468,"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-03T15:33:29.172Z","updated_at":"2025-05-06T22:07:42.621Z","avatar_url":"https://github.com/willrax.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Marvin\n\nSlack bots using Elixir.\n\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed as:\n\n1. Add Marvin to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:marvin, \"~\u003e 0.3.1\"},\n    {:websocket_client, git: \"https://github.com/jeremyong/websocket_client\"}\n  ]\nend\n```\n\nYou'll need to add `websocket_client` manually.\n\n2. Ensure marvin is started before your application:\n\n```elixir\ndef application do\n  [applications: [:marvin]]\nend\n```\n\nYou'll need to set your bots Slack token in your applications config file.\n\n```elixir\nconfig :marvin, slack_token: \"secret\"\n```\n\n## Creating Bots\n\nBots are simple to create and can respond to mentions, direct messages and ambient conversation.\n\n```elixir\ndefmodule EchoBot do\n  use Marvin.Bot\n\n  # Here you can set a specific type of message and a regex pattern to match against\n  # Direct includes mentions and direct discussions with the bot. Patterns are case\n  # sensitive by default.\n\n  match {:direct, ~r/hello/}\n\n  def handle_message(message, slack) do\n    send_message(\"Hi!\", message.channel, slack)\n  end\nend\n```\n\nNext you'll need to tell Marvin to start your bots by adding them to your config file.\n\n```elixir\nconfig :marvin, bots: [EchoBot]\n```\n\nYou can also capture reactions being applied to a message.\n\n```elixir\ndefmodule EchoBot do\n  use Marvin.Bot\n\n  match {:reaction, \"coin\"}\n\n  def handle_message(message, slack) do\n    IO.puts \"A coin was given\"\n  end\nend\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillrax%2Fmarvin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillrax%2Fmarvin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillrax%2Fmarvin/lists"}