Oops fix error
This commit is contained in:
parent
37e8d81bee
commit
cc99b028c6
2 changed files with 13 additions and 13 deletions
|
@ -6,7 +6,6 @@ import EventEmitter from 'https://deno.land/std@0.74.0/node/events.ts'
|
|||
import { DefaultCacheAdapter, ICacheAdapter } from './cacheAdapter.ts'
|
||||
import { UserManager } from '../managers/users.ts'
|
||||
import { GuildManager } from '../managers/guilds.ts'
|
||||
import { EmojisManager } from '../managers/emojis.ts'
|
||||
import { ChannelsManager } from '../managers/channels.ts'
|
||||
import { MessagesManager } from '../managers/messages.ts'
|
||||
import {
|
||||
|
@ -35,14 +34,13 @@ export class Client extends EventEmitter {
|
|||
user?: User
|
||||
ping = 0
|
||||
token?: string
|
||||
cache: ICacheAdapter = new DefaultCacheAdapter(this)
|
||||
cache: ICacheAdapter = new DefaultCacheAdapter()
|
||||
intents?: GatewayIntents[]
|
||||
forceNewSession?: boolean
|
||||
users: UserManager = new UserManager(this)
|
||||
guilds: GuildManager = new GuildManager(this)
|
||||
channels: ChannelsManager = new ChannelsManager(this)
|
||||
messages: MessagesManager = new MessagesManager(this)
|
||||
emojis: EmojisManager = new EmojisManager(this)
|
||||
bot: boolean = true
|
||||
canary: boolean = false
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@ import { Base } from './base.ts'
|
|||
import { Emoji } from './emoji.ts'
|
||||
import { VoiceState } from './voiceState.ts'
|
||||
import cache from '../models/cache.ts'
|
||||
import { RolesManager } from "../managers/roles.ts"
|
||||
import { GuildChannelsManager } from "../managers/guildChannels.ts"
|
||||
import { MembersManager } from "../managers/members.ts"
|
||||
import { RolesManager } from '../managers/roles.ts'
|
||||
import { GuildChannelsManager } from '../managers/guildChannels.ts'
|
||||
import { MembersManager } from '../managers/members.ts'
|
||||
import { EmojisManager } from '../managers/emojis.ts'
|
||||
|
||||
export class Guild extends Base {
|
||||
id: string
|
||||
|
@ -28,7 +29,7 @@ export class Guild extends Base {
|
|||
defaultMessageNotifications?: string
|
||||
explicitContentFilter?: string
|
||||
roles: RolesManager
|
||||
emojis?: Emoji[]
|
||||
emojis: EmojisManager
|
||||
features?: GuildFeatures[]
|
||||
mfaLevel?: string
|
||||
applicationID?: string
|
||||
|
@ -61,8 +62,13 @@ export class Guild extends Base {
|
|||
this.id = data.id
|
||||
this.unavailable = data.unavailable
|
||||
this.members = new MembersManager(this.client, this)
|
||||
this.channels = new GuildChannelsManager(this.client, this.client.channels, this)
|
||||
this.channels = new GuildChannelsManager(
|
||||
this.client,
|
||||
this.client.channels,
|
||||
this
|
||||
)
|
||||
this.roles = new RolesManager(this.client, this)
|
||||
this.emojis = new EmojisManager(this.client, this)
|
||||
|
||||
if (!this.unavailable) {
|
||||
this.name = data.name
|
||||
|
@ -156,10 +162,6 @@ export class Guild extends Base {
|
|||
// data.roles.map(
|
||||
// v => cache.get('role', v.id) ?? new Role(this.client, v)
|
||||
// ) ?? this.roles
|
||||
this.emojis =
|
||||
data.emojis.map(
|
||||
v => cache.get('emoji', v.id) ?? new Emoji(this.client, v)
|
||||
) ?? this.emojis
|
||||
this.features = data.features ?? this.features
|
||||
this.mfaLevel = data.mfa_level ?? this.mfaLevel
|
||||
this.systemChannelID = data.system_channel_id ?? this.systemChannelID
|
||||
|
|
Loading…
Reference in a new issue