SkillAgentSearch skills...

Coxir

A modern Elixir wrapper for Discord.

Install / Use

/learn @satom99/Coxir
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

coxir

License Validation Documentation Join Discord

A modern high-level Elixir wrapper for Discord.

Refer to the documentation for more information.

Features

  • Support for running multiple bots in a same application
  • Configurable adapters that change how the library behaves:
    • Limiter: handles how rate limit buckets are stored
    • Storage: handles how entities are cached
    • Sharder: handles how shards are started
    • Player: handles the audio sent through voice
  • Easy-to-use syntax for interacting with Discord entities

Installation

Add coxir as a dependency to your mix.exs file:

defp deps do
  [{:coxir, git: "https://github.com/satom99/coxir.git"}]
end

Quickstart

Before consuming events, coxir must be configured:

config :coxir,
  token: "",
  intents: :non_privileged # optional

Then a simple consumer can be set up as follows:

defmodule Example.Bot do
  use Coxir.Gateway
  
  alias Coxir.{User, Message}

  def handle_event({:MESSAGE_CREATE, %Message{content: "!hello"} = message}) do
    %Message{author: author} = Message.preload(message, :author)

    %User{username: username, discriminator: discriminator} = author

    Message.reply(message, content: "Hello #{username}##{discriminator}!")
  end
  
  def handle_event(_event) do
    :noop
  end
end

Which can then be added to a Supervisor, or started directly:

iex(1)> Example.Bot.start_link()
{:ok, #PID<0.301.0>}

For a complete and working example check out the example app.

More

For more information check out the documentation guides.

Related Skills

View on GitHub
GitHub Stars69
CategoryDevelopment
Updated3mo ago
Forks13

Languages

Elixir

Security Score

97/100

Audited on Dec 13, 2025

No findings