feat!: update to api version 10 (#2063)

* testing stuff

* feat: update to api version 10

* broken url import

* do changes

* delete test file
This commit is contained in:
ITOH
2022-02-14 20:00:58 +01:00
committed by GitHub
parent 7914ef1d11
commit cf747d5a63
6 changed files with 6 additions and 9 deletions
+1
View File
@@ -18,6 +18,7 @@ export function createRequestBody(rest: RestManager, queuedRequest: { request: R
// IF A REASON IS PROVIDED ENCODE IT IN HEADERS
if (queuedRequest.payload.body?.reason) {
headers["X-Audit-Log-Reason"] = encodeURIComponent(queuedRequest.payload.body.reason as string);
queuedRequest.payload.body.reason = undefined;
}
// IF A FILE/ATTACHMENT IS PRESENT WE NEED SPECIAL HANDLING
+2 -1
View File
@@ -10,9 +10,10 @@ import { RestPayload, RestRateLimitedPath, RestRequest } from "./rest.ts";
import { runMethod } from "./runMethod.ts";
import { simplifyUrl } from "./simplifyUrl.ts";
import { baseEndpoints } from "../util/constants.ts";
import { API_VERSION } from "../util/constants.ts";
export function createRestManager(options: CreateRestManagerOptions) {
const version = options.version || "9";
const version = options.version || API_VERSION;
if (options.customUrl) {
baseEndpoints.BASE_URL = `${options.customUrl}/v${version}`;
-3
View File
@@ -14,7 +14,6 @@ export function transformApplication(bot: Bot, payload: SnakeCasedPropertiesDeep
botRequireCodeGrant: payload.bot_require_code_grant,
termsOfServiceUrl: payload.terms_of_service_url,
privacyPolicyUrl: payload.privacy_policy_url,
summary: payload.summary,
verifyKey: payload.verify_key,
primarySkuId: payload.primary_sku_id,
slug: payload.slug,
@@ -51,8 +50,6 @@ export interface DiscordenoApplication {
privacyPolicyUrl?: string;
/** Partial user object containing info on the owner of the application */
owner?: Partial<DiscordenoUser>;
/** If this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */
summary: string;
/** The hex encoded key for verification in interactions and the GameSDK's GetTicket */
verifyKey: string;
/** If the application belongs to a team, this will be a list of the members of that team */
-2
View File
@@ -24,8 +24,6 @@ export interface Application {
privacyPolicyUrl?: string;
/** Partial user object containing info on the owner of the application */
owner?: Partial<User>;
/** If this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku */
summary: string;
/** The hex encoded key for verification in interactions and the GameSDK's GetTicket */
verifyKey: string;
/** If the application belongs to a team, this will be a list of the members of that team */
+1 -1
View File
@@ -23,7 +23,7 @@ export interface EditMessage {
users?: bigint[];
})
| null;
/** Attached files to keep */
/** When specified (adding new attachments), attachments which are not provided in this list will be removed. */
attachments?: Attachment[];
/** The components you would like to have sent in this message */
components?: MessageComponents;
+2 -2
View File
@@ -2,10 +2,10 @@
export const BASE_URL = "https://discord.com/api";
/** https://discord.com/developers/docs/reference#api-versioning-api-versions */
export const API_VERSION = 9;
export const API_VERSION = 10;
/** https://discord.com/developers/docs/topics/gateway#gateways-gateway-versions */
export const GATEWAY_VERSION = 9;
export const GATEWAY_VERSION = 10;
// TODO: update this version
/** https://github.com/discordeno/discordeno/releases */