Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
19 changes: 19 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Close Stale Pull Requests
on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
days-before-pr-stale: 30 # Mark PR as stale after 30 days of inactivity
days-before-pr-close: 7 # Close PR 7 days after being marked as stale
stale-pr-message: 'This pull request has been marked as stale due to inactivity for 30 days. It will be closed in 7 days if no further activity occurs.'
close-pr-message: 'This pull request has been closed due to inactivity for 7 days after being marked as stale.'
stale-pr-label: 'stale' # Label to add when marking as stale
exempt-pr-labels: 'pinned,security' # PRs with these labels will not be marked as stale
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

Expand Down
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "dc_rest"
version = "10.0.0"
authors = ["CtrlX <gitctrlx@gmail.com>"]
description = "Preview of the Discord v10 HTTP API specification. See https://discord.com/developers/docs for more details."
license = "MIT"
edition = "2024"

[dependencies]
serde = { version = "^1.0", features = ["derive"] }
serde_with = { version = "^3.13", default-features = false, features = ["base64", "std", "macros"] }
serde_json = "^1.0"
serde_repr = "^0.1"
url = "^2.5"
async-trait = "^0.1"
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }
reqwest-middleware = { version = "^0.4", features = ["json", "multipart"], optional = true }

[features]
default = ["native-tls"]
native-tls = ["reqwest/native-tls"]
rustls = ["reqwest/rustls-tls"]
middleware = ["reqwest-middleware"]
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

724 changes: 722 additions & 2 deletions README.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/AccountResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AccountResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**name** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/ActionRowComponentForMessageRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ActionRowComponentForMessageRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**components** | [**Vec<models::ActionRowComponentForMessageRequestComponentsInner>**](ActionRowComponentForMessageRequest_components_inner.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/ActionRowComponentForMessageRequestComponentsInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ActionRowComponentForMessageRequestComponentsInner

## Enum Variants

| Name | Description |
|---- | -----|
| ButtonComponentForMessageRequest | |
| ChannelSelectComponentForMessageRequest | |
| MentionableSelectComponentForMessageRequest | |
| RoleSelectComponentForMessageRequest | |
| StringSelectComponentForMessageRequest | |
| UserSelectComponentForMessageRequest | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/ActionRowComponentForModalRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ActionRowComponentForModalRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**components** | [**Vec<models::TextInputComponentForModalRequest>**](TextInputComponentForModalRequest.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


13 changes: 13 additions & 0 deletions docs/ActionRowComponentResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ActionRowComponentResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**id** | **i32** | |
**components** | Option<[**Vec<models::ActionRowComponentResponseComponentsInner>**](ActionRowComponentResponse_components_inner.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


17 changes: 17 additions & 0 deletions docs/ActionRowComponentResponseComponentsInner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ActionRowComponentResponseComponentsInner

## Enum Variants

| Name | Description |
|---- | -----|
| ButtonComponentResponse | |
| ChannelSelectComponentResponse | |
| MentionableSelectComponentResponse | |
| RoleSelectComponentResponse | |
| StringSelectComponentResponse | |
| TextInputComponentResponse | |
| UserSelectComponentResponse | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 11 additions & 0 deletions docs/ActivitiesAttachmentResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ActivitiesAttachmentResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**attachment** | [**models::AttachmentResponse**](AttachmentResponse.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AddGroupDmUser201Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AddGroupDmUser201Response

## Enum Variants

| Name | Description |
|---- | -----|
| PrivateChannelResponse | |
| PrivateGroupChannelResponse | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AddGroupDmUserRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AddGroupDmUserRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**access_token** | Option<**String**> | | [optional]
**nick** | Option<**String**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/AddGuildMemberRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AddGuildMemberRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nick** | Option<**String**> | | [optional]
**roles** | Option<**Vec<String>**> | | [optional]
**mute** | Option<**bool**> | | [optional]
**deaf** | Option<**bool**> | | [optional]
**access_token** | **String** | |
**flags** | Option<**i32**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/AddLobbyMemberRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AddLobbyMemberRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**metadata** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**flags** | Option<**i32**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/ApplicationCommandAttachmentOption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ApplicationCommandAttachmentOption

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


18 changes: 18 additions & 0 deletions docs/ApplicationCommandAttachmentOptionResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ApplicationCommandAttachmentOptionResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localized** | Option<**String**> | | [optional]
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localized** | Option<**String**> | | [optional]
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions docs/ApplicationCommandAutocompleteCallbackRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ApplicationCommandAutocompleteCallbackRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | Option<**i32**> | |
**data** | [**models::ApplicationCommandAutocompleteCallbackRequestData**](ApplicationCommandAutocompleteCallbackRequest_data.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 11 additions & 0 deletions docs/ApplicationCommandAutocompleteCallbackRequestData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ApplicationCommandAutocompleteCallbackRequestData

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**choices** | Option<[**Vec<models::ApplicationCommandOptionStringChoice>**](ApplicationCommandOptionStringChoice.md)> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


16 changes: 16 additions & 0 deletions docs/ApplicationCommandBooleanOption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ApplicationCommandBooleanOption

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


18 changes: 18 additions & 0 deletions docs/ApplicationCommandBooleanOptionResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ApplicationCommandBooleanOptionResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localized** | Option<**String**> | | [optional]
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localized** | Option<**String**> | | [optional]
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


17 changes: 17 additions & 0 deletions docs/ApplicationCommandChannelOption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ApplicationCommandChannelOption

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]
**channel_types** | Option<**Vec<i32>**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


19 changes: 19 additions & 0 deletions docs/ApplicationCommandChannelOptionResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ApplicationCommandChannelOptionResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **i32** | |
**name** | **String** | |
**name_localized** | Option<**String**> | | [optional]
**name_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**description** | **String** | |
**description_localized** | Option<**String**> | | [optional]
**description_localizations** | Option<**std::collections::HashMap<String, String>**> | | [optional]
**required** | Option<**bool**> | | [optional]
**channel_types** | Option<**Vec<i32>**> | | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading