Skip to content

Commit 8eb66a1

Browse files
authored
feat(RESTPostAPIChannelThreadsResult): narrow response (#1364)
1 parent 5a07684 commit 8eb66a1

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

deno/rest/v10/channel.ts

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v9/channel.ts

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rest/v10/channel.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import type {
2525
APIAttachment,
2626
APIMessageTopLevelComponent,
2727
APIMessagePin,
28+
APIAnnouncementThreadChannel,
29+
APIPrivateThreadChannel,
30+
APIPublicThreadChannel,
2831
} from '../../payloads/v10/index';
2932
import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals';
3033
import type { RESTAPIPoll } from './poll';
@@ -767,7 +770,10 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
767770
/**
768771
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
769772
*/
770-
export type RESTPostAPIChannelThreadsResult = APIChannel;
773+
export type RESTPostAPIChannelThreadsResult =
774+
| APIAnnouncementThreadChannel
775+
| APIPrivateThreadChannel
776+
| APIPublicThreadChannel;
771777

772778
/**
773779
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}

rest/v9/channel.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import type {
2525
APIAttachment,
2626
APIMessageTopLevelComponent,
2727
APIMessagePin,
28+
APIAnnouncementThreadChannel,
29+
APIPrivateThreadChannel,
30+
APIPublicThreadChannel,
2831
} from '../../payloads/v9/index';
2932
import type { _AddUndefinedToPossiblyUndefinedPropertiesOfInterface, _StrictPartial } from '../../utils/internals';
3033
import type { RESTAPIPoll } from './poll';
@@ -780,7 +783,10 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
780783
/**
781784
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
782785
*/
783-
export type RESTPostAPIChannelThreadsResult = APIChannel;
786+
export type RESTPostAPIChannelThreadsResult =
787+
| APIAnnouncementThreadChannel
788+
| APIPrivateThreadChannel
789+
| APIPublicThreadChannel;
784790

785791
/**
786792
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}

0 commit comments

Comments
 (0)