Clean Up Some Codes and Names
Co-Authored-By: Aki <71239005+AkiaCode@users.noreply.github.com>
This commit is contained in:
parent
1e8475456a
commit
9f9a8d6066
12 changed files with 18 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -109,3 +109,4 @@ yarn.lock
|
||||||
|
|
||||||
# PRIVACY XDDDD
|
# PRIVACY XDDDD
|
||||||
src/test/config.ts
|
src/test/config.ts
|
||||||
|
.vscode
|
||||||
|
|
|
@ -5,7 +5,6 @@ class Rest {
|
||||||
constructor (client: Client) {
|
constructor (client: Client) {
|
||||||
this.client = client
|
this.client = client
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: make endpoints function
|
//TODO: make endpoints function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
import { Client } from '../models/client.ts'
|
import { Client } from '../models/client.ts'
|
||||||
|
|
||||||
export class Base {
|
export class Base {
|
||||||
// property 읍
|
|
||||||
client: Client
|
client: Client
|
||||||
constructor (client: Client) {
|
constructor (client: Client) {
|
||||||
this.client = client
|
this.client = client
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// discord.js 보는중
|
|
||||||
|
|
|
@ -10,9 +10,11 @@ import {
|
||||||
ChannelTypes
|
ChannelTypes
|
||||||
} from '../types/channelTypes.ts'
|
} from '../types/channelTypes.ts'
|
||||||
import { Base } from './base.ts'
|
import { Base } from './base.ts'
|
||||||
import { DMChannel } from './dm.ts'
|
import { CategoryChannel } from './guildCategoryChannel.ts'
|
||||||
import { GroupChannel } from './groupChannel.ts'
|
|
||||||
import { VoiceChannel } from './guildVoiceChannel.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'
|
import { TextChannel } from './textChannel.ts'
|
||||||
|
|
||||||
export class Channel extends Base {
|
export class Channel extends Base {
|
||||||
|
@ -41,9 +43,9 @@ export class Channel extends Base {
|
||||||
) {
|
) {
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case ChannelTypes.GUILD_CATEGORY:
|
case ChannelTypes.GUILD_CATEGORY:
|
||||||
return
|
return new CategoryChannel(client, data as GuildChannelCategoryPayload)
|
||||||
case ChannelTypes.GUILD_NEWS:
|
case ChannelTypes.GUILD_NEWS:
|
||||||
return
|
return new NewsChannel(client, data as GuildNewsChannelPayload)
|
||||||
case ChannelTypes.GUILD_TEXT:
|
case ChannelTypes.GUILD_TEXT:
|
||||||
return new TextChannel(client, data as GuildTextChannelPayload)
|
return new TextChannel(client, data as GuildTextChannelPayload)
|
||||||
case ChannelTypes.GUILD_VOICE:
|
case ChannelTypes.GUILD_VOICE:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { Client } from '../models/client.ts'
|
import { Client } from '../models/client.ts'
|
||||||
|
import { Base } from './base.ts'
|
||||||
import {
|
import {
|
||||||
EmbedAuthor,
|
EmbedAuthor,
|
||||||
EmbedField,
|
EmbedField,
|
||||||
|
@ -10,7 +11,6 @@ import {
|
||||||
EmbedTypes,
|
EmbedTypes,
|
||||||
EmbedVideo
|
EmbedVideo
|
||||||
} from '../types/channelTypes.ts'
|
} from '../types/channelTypes.ts'
|
||||||
import { Base } from './base.ts'
|
|
||||||
|
|
||||||
export class Embed extends Base {
|
export class Embed extends Base {
|
||||||
title?: string
|
title?: string
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Client } from '../models/client.ts'
|
||||||
import { EmojiPayload } from '../types/emojiTypes.ts'
|
import { EmojiPayload } from '../types/emojiTypes.ts'
|
||||||
import { UserPayload } from '../types/userTypes.ts'
|
import { UserPayload } from '../types/userTypes.ts'
|
||||||
import { Base } from './base.ts'
|
import { Base } from './base.ts'
|
||||||
import { User } from './user.ts'
|
|
||||||
|
|
||||||
export class Emoji extends Base {
|
export class Emoji extends Base {
|
||||||
id: string
|
id: string
|
||||||
|
|
|
@ -11,7 +11,6 @@ import { PresenceUpdatePayload } from '../types/presenceTypes.ts'
|
||||||
import { RolePayload } from '../types/roleTypes.ts'
|
import { RolePayload } from '../types/roleTypes.ts'
|
||||||
import { VoiceStatePayload } from '../types/voiceTypes.ts'
|
import { VoiceStatePayload } from '../types/voiceTypes.ts'
|
||||||
import { Base } from './base.ts'
|
import { Base } from './base.ts'
|
||||||
import { Role } from './role.ts'
|
|
||||||
import * as cache from '../models/cache.ts'
|
import * as cache from '../models/cache.ts'
|
||||||
|
|
||||||
export class Guild extends Base {
|
export class Guild extends Base {
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import { Client } from '../models/client.ts'
|
import { Client } from '../models/client.ts'
|
||||||
import { Channel } from './channel.ts'
|
import { Channel } from './channel.ts'
|
||||||
import { GuildPayload, GuildFeatures } from '../types/guildTypes.ts'
|
|
||||||
import {
|
import {
|
||||||
GuildChannelCategoryPayload,
|
GuildChannelCategoryPayload,
|
||||||
Overwrite
|
Overwrite
|
||||||
} from '../types/channelTypes.ts'
|
} from '../types/channelTypes.ts'
|
||||||
|
|
||||||
export class categoryChannel extends Channel {
|
export class CategoryChannel extends Channel {
|
||||||
guildID: string
|
guildID: string
|
||||||
name: string
|
name: string
|
||||||
position: number
|
position: number
|
9
src/structures/guildnewsChannel.ts
Normal file
9
src/structures/guildnewsChannel.ts
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,4 @@
|
||||||
import { Client } from '../models/client.ts'
|
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 { ChannelPayload } from '../types/channelTypes.ts'
|
||||||
import { GuildPayload } from '../types/guildTypes.ts'
|
import { GuildPayload } from '../types/guildTypes.ts'
|
||||||
import { InvitePayload } from '../types/inviteTypes.ts'
|
import { InvitePayload } from '../types/inviteTypes.ts'
|
||||||
|
|
|
@ -10,9 +10,6 @@ import {
|
||||||
Reaction
|
Reaction
|
||||||
} from '../types/channelTypes.ts'
|
} from '../types/channelTypes.ts'
|
||||||
import { Client } from '../models/client.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 { UserPayload } from '../types/userTypes.ts'
|
||||||
import { RolePayload } from '../types/roleTypes.ts'
|
import { RolePayload } from '../types/roleTypes.ts'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue