From 0120b4b837af4151418006f97fe3fee0db424885 Mon Sep 17 00:00:00 2001 From: Donghan Date: Thu, 22 Oct 2020 12:36:31 +0900 Subject: [PATCH] Update endpoint.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 넌 너무 아름다워서 --- src/types/endpoint.ts | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/types/endpoint.ts b/src/types/endpoint.ts index 27d8615..d2d4ad2 100644 --- a/src/types/endpoint.ts +++ b/src/types/endpoint.ts @@ -1,4 +1,4 @@ -//Being Written by Choi Donghan, Catry +//Written by Choi Donghan, Catry import { DISCORD_API_URL, @@ -81,26 +81,44 @@ const CHANNEL_PINS = (channelID: string) => `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/channels/${channelID}/pins` //User Endpoints +const CURRENT_USER = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me` +const CURRENT_USER_GUILDS = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/guilds` +const USER_DM = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/channels` +const USER_CONNECTIONS = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/connections` +const LEAVE_GUILD = (guildID: string) => + `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/guilds/${guildID}` const USER = (userID: string) => `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/${userID}` -const USER_CREATE_DM = () => - `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/channels` + + //Webhook Endpoints -const WEBHOOKS = (channelID: string) => +const CHANNEL_WEBHOOKS = (channelID: string) => `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/channels/${channelID}/webhooks` -const GUILD_WEBHOOK = (guildID :string) => +const GUILD_WEBHOOK = (guildID: string) => `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/webhooks` +const WEBHOOK = (webhookID: string) => + `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/webhooks/${webhookID}` +const WEBHOOK_WITH_TOKEN = (webhookID: string, webhookTOKEN: string) => + `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/webhooks/${webhookID}/${webhookTOKEN}` +const SLACK_WEBHOOK = (webhookID: string, webhookTOKEN: string) => + `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/webhooks/${webhookID}/${webhookTOKEN}/slack` +const GITHUB_WEBHOOK = (webhookID: string, webhookTOKEN: string) => + `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/webhooks/${webhookID}/${webhookTOKEN}/github` + +//Gateway Endpoints +const GATEWAY = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/gateway` +const GATEWAY_BOT = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/gateway/bot` //CDN Endpoints const CUSTOM_EMOJI = (emojiID: string) => - `${DISCORD_CDN_URL}/emojis${emojiID}.png` + `${DISCORD_CDN_URL}/emojis/${emojiID}.png` const GUILD_ICON = (guildID: string, iconID: number) => `${DISCORD_CDN_URL}/icons/${guildID}/${iconID}.png` const GUILD_SPLASH = (guildID: string, guildSPLASH: string) => `${DISCORD_CDN_URL}/splashes/${guildID}/${guildSPLASH}.png` const GUILD_DISCOVERY_SPLASH = (guildID: string, guildDiscoverySplash: string) => - `${DISCORD_CDN_URL}discovery-splashes/${guildID}/${guildDiscoverySplash}.png ` + `${DISCORD_CDN_URL}/discovery-splashes/${guildID}/${guildDiscoverySplash}.png ` const GUILD_BANNER = (guildID: string, guildBANNER: string) => `${DISCORD_CDN_URL}/banners/${guildID}/${guildBANNER}.png` const DEFAULT_USER_AVATAR = (iconID: string) =>