Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spaceeec/crux_rest
A Discord API rest library
https://github.com/spaceeec/crux_rest
discord discord-api elixir hacktoberfest library rest
Last synced: 2 months ago
JSON representation
A Discord API rest library
- Host: GitHub
- URL: https://github.com/spaceeec/crux_rest
- Owner: SpaceEEC
- License: mit
- Created: 2018-04-25T16:33:52.000Z (over 6 years ago)
- Default Branch: trunk
- Last Pushed: 2022-01-09T12:40:00.000Z (about 3 years ago)
- Last Synced: 2024-05-12T10:32:04.132Z (8 months ago)
- Topics: discord, discord-api, elixir, hacktoberfest, library, rest
- Language: Elixir
- Homepage:
- Size: 1.6 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Crux.Rest [![](https://github.com/SpaceEEC/crux_rest/workflows/Tests/badge.svg?event=push&branch=trunk)](https://github.com/SpaceEEC/crux_rest/actions) [![](https://github.com/SpaceEEC/crux_rest/workflows/Documentation/badge.svg?event=push&branch=trunk)](https://spaceeec.github.io/crux_rest)
Library providing rest functions and rate limiting for the [Discord API](https://discord.com/developers/docs/).
## Useful links
- [Documentation](https://hexdocs.pm/crux_rest/0.2.2/)
- [Github](https://github.com/SpaceEEC/crux_rest/)
- [Changelog](https://github.com/SpaceEEC/crux_rest/releases/tag/0.2.2/)
- [Crux Libraries Overview](https://github.com/SpaceEEC/crux)
- [Trunk Documentation](https://spaceeec.github.io/crux_rest/)## Installation
The library can be installed by adding `crux_rest` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:crux_rest, "~> 0.2.2"}
]
end
```## Usage
For example:
```elixir
iex> defmodule MyBot.Rest do
...> use Crux.Rest
...> end
{:module, MyBot.Rest, <<...>>, :ok}iex> {:ok, pid} = MyBot.Rest.start_link(token: "token")
{:ok, #PID<0.100.0>}iex> MyBot.Rest.create_message!(445290716198076427, content: "Hello there!")
%Crux.Structs.Message{
content: "Hello there!",
author: %Crux.Structs.User{...},
...
}
```