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
types: Add tagged type
unions for channel types
#200
types: Add tagged type
unions for channel types
#200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mad lad for tackling this issue, and overall, great start! Still needs some work tho, as well as the same change in v8 :D
😦 |
So I tried my best to integrate the changes you requested, let me know if there's anything else. I'll work on v8 after v9 is finalized. Also if you need to test the typings I'm using this file to verify everything is working as expected: /* eslint-disable @typescript-eslint/no-unused-vars */
import { APIChannel, ChannelType } from '.';
const guildTextChannel: APIChannel = {
id: '12',
type: ChannelType.GuildText,
name: 'general',
position: 6,
permission_overwrites: [],
rate_limit_per_user: 2,
nsfw: true,
topic: 'topic',
last_message_id: '12',
default_auto_archive_duration: 60,
};
const guildNewsChannel: APIChannel = {
id: '12',
type: ChannelType.GuildNews,
name: 'general',
position: 6,
permission_overwrites: [],
nsfw: true,
topic: 'topic',
last_message_id: '12',
default_auto_archive_duration: 60,
};
const guildNewsThread: APIChannel = {
id: '12',
type: ChannelType.GuildNewsThread,
name: 'general',
position: 6,
permission_overwrites: [],
nsfw: true,
last_message_id: '12',
thread_metadata: {
archived: false,
auto_archive_duration: 1440,
archive_timestamp: 'date',
locked: false,
},
};
const guildVoiceChannel: APIChannel = {
id: '12',
type: ChannelType.GuildVoice,
name: 'general',
position: 6,
permission_overwrites: [],
nsfw: true,
bitrate: 64000,
user_limit: 0,
parent_id: null,
rtc_region: null,
};
const DMChannel: APIChannel = {
id: '12',
type: ChannelType.DM,
recipients: [],
last_message_id: '12',
};
const groupDMChannel: APIChannel = {
id: '12',
type: ChannelType.GroupDM,
recipients: [],
last_message_id: '12',
owner_id: '12',
icon: null,
};
const categoryChannel: APIChannel = {
id: '12',
type: ChannelType.GuildCategory,
name: 'general',
position: 6,
permission_overwrites: [],
nsfw: true,
};
const storeChannel: APIChannel = {
id: '12',
type: ChannelType.GuildStore,
name: 'general',
position: 6,
permission_overwrites: [],
nsfw: true,
parent_id: null,
};
const threadChannel: APIChannel = {
id: '12',
guild_id: '12',
owner_id: '12',
parent_id: '12',
name: 'general',
type: ChannelType.GuildPublicThread,
last_message_id: '12',
member_count: 1,
message_count: 5,
rate_limit_per_user: 2,
thread_metadata: {
archived: false,
auto_archive_duration: 1440,
archive_timestamp: 'date',
locked: false,
},
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small issues, please fix in non-deno ones
6ad1ccd
to
cef57a5
Compare
So v8 will pretty much be the same, just without the threads right? |
Yep yep |
…into types/channel-type-unions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more requested changes for you, please apply them to v9/v8 and then run the deno script 🙏
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
6584eac
to
b0164f7
Compare
…into types/channel-type-unions
…tipirneni/discord-api-types into types/channel-type-unions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're reaching a point where having to keep these types updates is probably gonna be annoying to do..
Well what do you know, the curse follows everyone as this PR needs a rebase |
…into types/channel-type-unions
…tipirneni/discord-api-types into types/channel-type-unions
Please describe the changes this PR makes and why it should be merged:
Closes #61
Reference Discord API Docs PRs or commits:
https://discord.com/developers/docs/resources/channel#channel-object-channel-types