Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reason to follow announcement channel endpoint #10274

Closed
Jiralite opened this issue May 14, 2024 · 0 comments · Fixed by #10275
Closed

Add reason to follow announcement channel endpoint #10274

Jiralite opened this issue May 14, 2024 · 0 comments · Fixed by #10275

Comments

@Jiralite
Copy link
Member

Which application or package is this feature request for?

core

Feature

Per discord/discord-api-docs#6559, reason should be utilised:

/**
* Follows an announcement channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
* @param channelId - The id of the announcement channel to follow
* @param webhookChannelId - The id of the webhook channel to follow the announcements in
* @param options - The options for following the announcement channel
*/
public async followAnnouncements(
channelId: Snowflake,
webhookChannelId: Snowflake,
{ signal }: Pick<RequestData, 'signal'> = {},
) {
return this.rest.post(Routes.channelFollowers(channelId), {
body: { webhook_channel_id: webhookChannelId },
signal,
}) as Promise<RESTPostAPIChannelFollowersResult>;
}

Ideal solution or implementation

Implement reason. An example exists right below the aforementioned method:

/**
* Creates a new invite for a channel
*
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
* @param channelId - The id of the channel to create an invite for
* @param body - The data for creating the invite
* @param options - The options for creating the invite
*/
public async createInvite(
channelId: Snowflake,
body: RESTPostAPIChannelInviteJSONBody,
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {},
) {
return this.rest.post(Routes.channelInvites(channelId), {
reason,
body,
signal,
}) as Promise<RESTPostAPIChannelInviteResult>;
}

Alternative solutions or implementations

No response

Other context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant