Skip to content

Commit

Permalink
fix(*): replace references of discordapp.com with discord.com (#8)
Browse files Browse the repository at this point in the history
SpaceEEC authored Oct 10, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 0f5a2ce commit 061c85e
Showing 6 changed files with 96 additions and 97 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Crux.Rest

Library providing rest functions and rate limiting for the [Discord API](https://discordapp.com/developers).
Library providing rest functions and rate limiting for the [Discord API](https://discord.com/developers/docs/).

## Useful links

180 changes: 90 additions & 90 deletions lib/rest.ex

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/rest/api_error.ex
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ defmodule Crux.Rest.ApiError do
| Property | Description | Example(s) |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
| `status_code` | HTTP status code | `400`, `404`, `403` |
| `code` | See Discord's [JSON Error Codes](https://discordapp.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes) | `10006`, `90001` |
| `code` | See Discord's [JSON Error Codes](https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes) | `10006`, `90001` |
| `message` | Message describing the error | `Unknown Invite` |
| `path` | Path of the request | `/invites/broken` |
| `method` | HTTP verb | :get, :post, :patch |
2 changes: 1 addition & 1 deletion lib/rest/endpoints.ex
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ defmodule Crux.Rest.Endpoints do

Version.modulesince("0.1.0")

@base_url "https://discordapp.com/api/v7"
@base_url "https://discord.com/api/v7"

@doc """
Base API address.
5 changes: 2 additions & 3 deletions lib/rest/functions.ex
Original file line number Diff line number Diff line change
@@ -123,9 +123,8 @@ defmodule Crux.Rest.Functions do
message,
&Endpoints.channel_messages/2
)
# Separate route as this is an exception
# See the first info box here:
# https://discordapp.com/developers/docs/topics/rate-limits#rate-limits
# Separate route as this is an exception.
# This used to be documented, but is not anymore.
|> Map.update!(:route, &Kernel.<>(&1, "/delete"))
end

2 changes: 1 addition & 1 deletion lib/rest/http.ex
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ defmodule Crux.Rest.HTTP do

alias Crux.Rest.Endpoints

# See: https://discordapp.com/developers/docs/reference#user-agent
# See: https://discord.com/developers/docs/reference#user-agent
url = Project.config()[:source_url]
version = Project.config()[:version]
@user_agent "DiscordBot (#{url}, v#{version})"

0 comments on commit 061c85e

Please sign in to comment.