{"id":15042217,"url":"https://github.com/kraigie/nostrum","last_synced_at":"2025-05-15T02:06:47.584Z","repository":{"id":13162387,"uuid":"66679983","full_name":"Kraigie/nostrum","owner":"Kraigie","description":"Elixir Discord Library","archived":false,"fork":false,"pushed_at":"2025-04-26T16:04:17.000Z","size":118195,"stargazers_count":669,"open_issues_count":26,"forks_count":132,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-15T02:06:44.937Z","etag":null,"topics":["bot","discord","discord-api","discord-bot","discordapp","elixir","library","nostrum"],"latest_commit_sha":null,"homepage":"https://kraigie.github.io/nostrum/","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/Kraigie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2016-08-26T21:18:34.000Z","updated_at":"2025-05-14T06:57:20.000Z","dependencies_parsed_at":"2023-10-19T10:36:21.555Z","dependency_job_id":"46d6bb2c-03ce-4bf0-b1a4-fbabebd8a2ea","html_url":"https://github.com/Kraigie/nostrum","commit_stats":{"total_commits":1402,"total_committers":70,"mean_commits":20.02857142857143,"dds":0.6476462196861626,"last_synced_commit":"08e6bda54dbec621679dd488568a9ccefcbdba6f"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kraigie%2Fnostrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kraigie%2Fnostrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kraigie%2Fnostrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kraigie%2Fnostrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kraigie","download_url":"https://codeload.github.com/Kraigie/nostrum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259370,"owners_count":22040819,"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","discord","discord-api","discord-bot","discordapp","elixir","library","nostrum"],"created_at":"2024-09-24T20:47:00.095Z","updated_at":"2025-05-15T02:06:47.566Z","avatar_url":"https://github.com/Kraigie.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nostrum\n\n[![Build Status](https://github.com/Kraigie/nostrum/workflows/Test%20\u0026%20Lint/badge.svg)](https://github.com/Kraigie/nostrum/actions)\n[![Join Discord](https://img.shields.io/badge/discord-join-7289DA.svg)](https://discord.gg/2Bgn8nW)\n[![hex.pm](https://img.shields.io/hexpm/v/nostrum.svg)](https://hex.pm/packages/nostrum/)\n\n\nAn [Elixir](http://elixir-lang.org/) library for the Discord API. nostrum\nsupports the following:\n\n- Clean REST API implementation and ratelimiting.\n- Documented structs and abstractions over API objects.\n- Automatic, configurable maintenance of local caches of Discord data, with\n  cache swapping functionality.\n- Ability to run multiple bots.\n- Support for multi-node distribution of caches and internal state, including\n  live migration of bots between nodes.\n- Listening and sending voice data, with helpers for common functionality.\n\nIt is highly recommended to check out the [release\ndocumentation](https://hexdocs.pm/nostrum/) first. It includes all of the\ninformation listed here and more. **This README is for the master branch**,\nwhich includes recent developments and may be unstable. If you want to live on\nthe edge regardless, you can check the [pre-release\ndocumentation](https://kraigie.github.io/nostrum/).\n\n## Installation\n\nIt is recommended to use a **stable** release by specifying a published\nversion from Hex:\n\n```elixir\ndef deps do\n  [{:nostrum, \"~\u003e 0.10\"}]\nend\n```\n\nFor stable installations, documentation can be found at\nhttps://hexdocs.pm/nostrum. However, if you want the latest changes and help\ntest the library, you can also install directly from GitHub:\n\n```elixir\ndef deps do\n  [{:nostrum, github: \"Kraigie/nostrum\"}]\nend\n```\n\nDocumentation for master can be found at https://kraigie.github.io/nostrum/.\n\nSee the [intro guide (master)](https://kraigie.github.io/nostrum/intro.html) or\nthe [intro guide for the stable release](https://hexdocs.pm/nostrum/intro.html)\nto learn how to get started with your bot.\n\n\u003e **Note:** Due to Discord API changes, _in order to receive message content_ (e.g.\nfor non-slash commands or moderation tools), you need to have the \"Message\nContent Intent\" enabled on your [Bot's application\nsettings](https://discord.com/developers/applications/), and the\n`:message_content` intent specified in the `:intents` bot option.\n\nFor more information about the differences between dev and stable as well as\nadditional config parameters, please see the\n[documentation](https://kraigie.github.io/nostrum/).\n\n## Example Usage\nThe below module needs to be defined and configured as your bot's consumer to capture \nevents. See [here](https://github.com/Kraigie/nostrum/blob/master/examples/event_consumer.ex)\nfor a full example.\n\n```elixir\ndefmodule ExampleConsumer do\n  @behaviour Nostrum.Consumer\n\n  alias Nostrum.Api.Message\n\n  def handle_event({:MESSAGE_CREATE, msg, _ws_state}) do\n    case msg.content do\n      \"ping!\" -\u003e\n        Message.create(msg.channel_id, \"I copy and pasted this code\")\n      _ -\u003e\n        :ignore\n    end\n  end\nend\n```\n\nYou can define and start your bot under your application supervision tree:\n\n```elixir\ndefmodule MyApp.Application do\n  use Application\n\n  def start(_type, _args) do\n    bot_options = %{\n      consumer: ExampleConsumer,\n      intents: [:direct_messages, :guild_messages, :message_content],\n      wrapped_token: fn -\u003e System.fetch_env!(\"BOT_TOKEN\") end\n    }\n\n    children = [{Nostrum.Bot, bot_options}]\n    Supervisor.start_link(children, strategy: :one_for_one)\n  end\nend\n```\n\nYou may also start bots dynamically at runtime from `iex`:\n\n```elixir\niex()\u003e bot_options = %{\n...()\u003e   consumer: ExampleConsumer,\n...()\u003e   intents: [:direct_messages, :guild_messages, :message_content],\n...()\u003e   wrapped_token: fn -\u003e System.fetch_env!(\"BOT_TOKEN\") end\n...()\u003e }\niex()\u003e Supervisor.start_link([{Nostrum.Bot, bot_options}], strategy: :one_for_one)\n{:ok, #PID\u003c0.208.0\u003e}\n```\n\n## Getting Help\n\nIf you need help, visit `#elixir_nostrum` on the unofficial Discord API guild!\n\n[![Discord API](https://discord.com/api/guilds/81384788765712384/embed.png?style=banner3)](https://discord.gg/2Bgn8nW)\n\n## Testimonials\n\n\u003e my first choice is always nostrum\n\u003e \n\u003e **- big nutty, javascript developer**\n\n\u003e i would feed my baby the latest nostrum release\n\u003e\n\u003e **- also big nutty**\n\n\u003e i've used nostrum for 6 years and i have never been let down. [...]\n\u003e\n\u003e **- Broman, Discord API Expert**\n\n## License\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkraigie%2Fnostrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkraigie%2Fnostrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkraigie%2Fnostrum/lists"}