From 6e1afa13a4687ac933078db4d1e90722c92b1009 Mon Sep 17 00:00:00 2001 From: Ayyan Date: Thu, 31 Dec 2020 19:51:42 +0400 Subject: [PATCH] docs(handlers): add jsdoc comment block (#313) * docs(handlers): add jsdoc comment block * style: format files --- src/api/handlers/channel.ts | 1 + src/api/handlers/guild.ts | 1 + src/api/handlers/message.ts | 1 + src/api/handlers/webhook.ts | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/api/handlers/channel.ts b/src/api/handlers/channel.ts index dbf3a3621..833ccde5c 100644 --- a/src/api/handlers/channel.ts +++ b/src/api/handlers/channel.ts @@ -356,6 +356,7 @@ function processEditChannelQueue() { } } +/** Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. */ export async function editChannel( channelID: string, options: ChannelEditOptions, diff --git a/src/api/handlers/guild.ts b/src/api/handlers/guild.ts index 28458c8bb..e77abf550 100644 --- a/src/api/handlers/guild.ts +++ b/src/api/handlers/guild.ts @@ -88,6 +88,7 @@ export function guildSplashURL( ) : undefined; } + /** The full URL of the banner from Discords CDN. Undefined if no banner is set. */ export function guildBannerURL( guild: Guild, diff --git a/src/api/handlers/message.ts b/src/api/handlers/message.ts index 6c55b0266..10b6e0e54 100644 --- a/src/api/handlers/message.ts +++ b/src/api/handlers/message.ts @@ -277,6 +277,7 @@ export async function editMessage( return structures.createMessage(result as MessageCreateOptions); } +/** Crosspost a message in a News Channel to following channels. */ export async function publishMessage(channelID: string, messageID: string) { const data = await RequestManager.post( endpoints.CHANNEL_MESSAGE_CROSSPOST(channelID, messageID), diff --git a/src/api/handlers/webhook.ts b/src/api/handlers/webhook.ts index 36811cc2b..5713c8ded 100644 --- a/src/api/handlers/webhook.ts +++ b/src/api/handlers/webhook.ts @@ -55,6 +55,7 @@ export async function createWebhook( ) as Promise; } +/** Execute a webhook with webhook ID and webhook token */ export async function executeWebhook( webhookID: string, webhookToken: string, @@ -113,6 +114,7 @@ export async function executeWebhook( return structures.createMessage(result as MessageCreateOptions); } +/** Returns the new webhook object for the given id. */ export function getWebhook(webhookID: string) { return RequestManager.get(endpoints.WEBHOOK_ID(webhookID)); }