Merge pull request #2 from AkiaCode/main

Add CDN Endpoints
This commit is contained in:
Helloyunho 2020-10-22 08:30:29 +09:00 committed by GitHub
commit 2ca8e1c56b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,10 +10,6 @@ import {
const GUILDS = `${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds`
const GUILD = (guildID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}`
const GUILD_ICON = (guildID: string, iconID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/${iconID}`
const GUILD_BANNER = (guildID: string, iconID: string) =>
`${DISCORD_CDN_URL}/${guildID}/${iconID}`
const GUILD_AUDIT_LOGS = (guildID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/audit-logs`
const GUILD_WIDGET = (guildID: string) =>
@ -48,19 +44,33 @@ const CHANNEL_MESSAGE = (channelID: string, messageID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/channels/${channelID}/messages/${messageID}`
const CHANNEL_CROSSPOST = (channelID: string, messageID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/channels/${channelID}/messages/${messageID}/crosspost`
const MESSAGE_REACTION = (
channelID: string,
messageID: string,
emoji: string
) =>
const MESSAGE_REACTION = (channelID: string, messageID: string, emoji: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`
//User Endpoints
const USER = (userID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/${userID}`
const USER_AVATAR_DEFAULT = (iconID: number) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/embed/avatars${iconID}.png`
const USER_AVATAR = (userID: string, iconID: string) =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/avatars/${userID}/${iconID}.png`
const USER_CREATE_DM = () =>
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/users/@me/channels`
//CDN Endpoints
const CUSTOM_EMOJI = (emojiID: string) =>
`${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 `
const GUILD_BANNER = (guildID: string, guildBANNER: string) =>
`${DISCORD_CDN_URL}/banners/${guildID}/${guildBANNER}.png`
const DEFAULT_USER_AVATAR = (iconID: string) =>
`${DISCORD_CDN_URL}/embed/avatars/${iconID}.png`
const USER_AVATAR = (userID: string, iconID: string) =>
`${DISCORD_CDN_URL}/avatars/${userID}/${iconID}.png`
const APPLICATION_ASSET = (applicationID: string, assetID: number) =>
`${DISCORD_CDN_URL}/app-icons/${applicationID}/${assetID}.png`
const ACHIEVEMENT_ICON = (applicationID: string, achievementID: string, iconHASH: string) =>
`${DISCORD_CDN_URL}/app-assets/${applicationID}/achievements/${achievementID}/icons/${iconHASH}.png`
const TEAM_ICON = (teamID: string, iconID: string) =>
`${DISCORD_CDN_URL}/team-icons/${teamID}/${iconID}.png`