diff --git a/.gitignore b/.gitignore index 6f6a9de..df7c588 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,4 @@ yarn.lock # PRIVACY XDDDD src/test/config.ts +.vscode diff --git a/src/models/rest.ts b/src/models/rest.ts index ccc18bf..cfff658 100644 --- a/src/models/rest.ts +++ b/src/models/rest.ts @@ -5,7 +5,6 @@ class Rest { constructor (client: Client) { this.client = client } - //TODO: make endpoints function } diff --git a/src/structures/base.ts b/src/structures/base.ts index 6f99de4..9edc83d 100644 --- a/src/structures/base.ts +++ b/src/structures/base.ts @@ -1,10 +1,8 @@ import { Client } from '../models/client.ts' export class Base { - // property 읍 client: Client constructor (client: Client) { this.client = client } } -// discord.js 보는중 diff --git a/src/structures/channel.ts b/src/structures/channel.ts index 883786f..80c5878 100644 --- a/src/structures/channel.ts +++ b/src/structures/channel.ts @@ -10,9 +10,11 @@ import { ChannelTypes } from '../types/channelTypes.ts' import { Base } from './base.ts' -import { DMChannel } from './dm.ts' -import { GroupChannel } from './groupChannel.ts' +import { CategoryChannel } from './guildCategoryChannel.ts' import { VoiceChannel } from './guildVoiceChannel.ts' +import { NewsChannel } from './guildnewsChannel.ts' +import { DMChannel } from './dmChannel.ts' +import { GroupChannel } from './groupChannel.ts' import { TextChannel } from './textChannel.ts' export class Channel extends Base { @@ -41,9 +43,9 @@ export class Channel extends Base { ) { switch (data.type) { case ChannelTypes.GUILD_CATEGORY: - return + return new CategoryChannel(client, data as GuildChannelCategoryPayload) case ChannelTypes.GUILD_NEWS: - return + return new NewsChannel(client, data as GuildNewsChannelPayload) case ChannelTypes.GUILD_TEXT: return new TextChannel(client, data as GuildTextChannelPayload) case ChannelTypes.GUILD_VOICE: diff --git a/src/structures/dm.ts b/src/structures/dmChannel.ts similarity index 100% rename from src/structures/dm.ts rename to src/structures/dmChannel.ts diff --git a/src/structures/embed.ts b/src/structures/embed.ts index 36c7109..aeee780 100644 --- a/src/structures/embed.ts +++ b/src/structures/embed.ts @@ -1,4 +1,5 @@ import { Client } from '../models/client.ts' +import { Base } from './base.ts' import { EmbedAuthor, EmbedField, @@ -10,7 +11,6 @@ import { EmbedTypes, EmbedVideo } from '../types/channelTypes.ts' -import { Base } from './base.ts' export class Embed extends Base { title?: string diff --git a/src/structures/emoji.ts b/src/structures/emoji.ts index b698de8..38949bd 100644 --- a/src/structures/emoji.ts +++ b/src/structures/emoji.ts @@ -2,7 +2,6 @@ import { Client } from '../models/client.ts' import { EmojiPayload } from '../types/emojiTypes.ts' import { UserPayload } from '../types/userTypes.ts' import { Base } from './base.ts' -import { User } from './user.ts' export class Emoji extends Base { id: string diff --git a/src/structures/guild.ts b/src/structures/guild.ts index d3617bc..293aa0b 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -11,7 +11,6 @@ import { PresenceUpdatePayload } from '../types/presenceTypes.ts' import { RolePayload } from '../types/roleTypes.ts' import { VoiceStatePayload } from '../types/voiceTypes.ts' import { Base } from './base.ts' -import { Role } from './role.ts' import * as cache from '../models/cache.ts' export class Guild extends Base { diff --git a/src/structures/categoryChannel.ts b/src/structures/guildCategoryChannel.ts similarity index 83% rename from src/structures/categoryChannel.ts rename to src/structures/guildCategoryChannel.ts index fa56298..57a06ae 100644 --- a/src/structures/categoryChannel.ts +++ b/src/structures/guildCategoryChannel.ts @@ -1,12 +1,11 @@ import { Client } from '../models/client.ts' import { Channel } from './channel.ts' -import { GuildPayload, GuildFeatures } from '../types/guildTypes.ts' import { GuildChannelCategoryPayload, Overwrite } from '../types/channelTypes.ts' -export class categoryChannel extends Channel { +export class CategoryChannel extends Channel { guildID: string name: string position: number diff --git a/src/structures/guildnewsChannel.ts b/src/structures/guildnewsChannel.ts new file mode 100644 index 0000000..0a67386 --- /dev/null +++ b/src/structures/guildnewsChannel.ts @@ -0,0 +1,9 @@ +import { Client } from '../models/client.ts' +import { Channel } from './channel.ts' +import { GuildNewsChannelPayload } from '../types/channelTypes.ts' + +export class NewsChannel extends Channel { + constructor (client: Client, data: GuildNewsChannelPayload) { + super(client, data) + } +} diff --git a/src/structures/invite.ts b/src/structures/invite.ts index 1e69428..4739b31 100644 --- a/src/structures/invite.ts +++ b/src/structures/invite.ts @@ -1,7 +1,4 @@ import { Client } from '../models/client.ts' -import { Channel } from '../structures/channel.ts' -import { Guild } from '../structures/guild.ts' -import { User } from '../structures/user.ts' import { ChannelPayload } from '../types/channelTypes.ts' import { GuildPayload } from '../types/guildTypes.ts' import { InvitePayload } from '../types/inviteTypes.ts' diff --git a/src/structures/message.ts b/src/structures/message.ts index 02670b2..327302a 100644 --- a/src/structures/message.ts +++ b/src/structures/message.ts @@ -10,9 +10,6 @@ import { Reaction } from '../types/channelTypes.ts' import { Client } from '../models/client.ts' -import { User } from './user.ts' -import { Role } from './role.ts' -import { Embed } from './embed.ts' import { UserPayload } from '../types/userTypes.ts' import { RolePayload } from '../types/roleTypes.ts'