Clean Up Some Codes and Names

Co-Authored-By: Aki <71239005+AkiaCode@users.noreply.github.com>
This commit is contained in:
Helloyunho 2020-10-24 21:11:54 +09:00
parent 1e8475456a
commit 9f9a8d6066
12 changed files with 18 additions and 18 deletions

1
.gitignore vendored
View File

@ -109,3 +109,4 @@ yarn.lock
# PRIVACY XDDDD
src/test/config.ts
.vscode

View File

@ -5,7 +5,6 @@ class Rest {
constructor (client: Client) {
this.client = client
}
//TODO: make endpoints function
}

View File

@ -1,10 +1,8 @@
import { Client } from '../models/client.ts'
export class Base {
// property 읍
client: Client
constructor (client: Client) {
this.client = client
}
}
// discord.js 보는중

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -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)
}
}

View File

@ -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'

View File

@ -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'