Fix some conflicts

This commit is contained in:
DjDeveloperr 2020-11-08 14:01:00 +05:30
parent 04f2912c3c
commit e15177c618
5 changed files with 26 additions and 10 deletions

View File

@ -8,9 +8,7 @@ export const guildBanAdd: GatewayEventHandler = async (
d: GuildBanAddPayload
) => {
const guild: Guild | undefined = await gateway.client.guilds.get(d.guild_id)
const user: User =
(await gateway.client.users.get(d.user.id)) ??
new User(gateway.client, d.user)
const user: User = await gateway.client.users.get(d.user.id) ?? new User(gateway.client, d.user)
if (guild !== undefined) {
await guild.members.delete(user.id)

View File

@ -4,7 +4,11 @@ import { Guild } from '../structures/guild.ts'
import { CategoryChannel } from '../structures/guildCategoryChannel.ts'
import { GuildTextChannel } from '../structures/guildTextChannel.ts'
import { VoiceChannel } from '../structures/guildVoiceChannel.ts'
import { GuildChannelCategoryPayload, GuildTextChannelPayload, GuildVoiceChannelPayload } from '../types/channel.ts'
import {
GuildChannelCategoryPayload,
GuildTextChannelPayload,
GuildVoiceChannelPayload
} from '../types/channel.ts'
import { CHANNEL } from '../types/endpoint.ts'
import { BaseChildManager } from './baseChild.ts'
import { ChannelsManager } from './channels.ts'

View File

@ -6,10 +6,14 @@ 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 { ActivityGame, ClientActivity, ClientPresence } from '../structures/presence.ts'
import {
ActivityGame,
ClientActivity,
ClientPresence
} from '../structures/presence.ts'
import { EmojisManager } from "../managers/emojis.ts"
/** Some Client Options to modify behaviour */
export interface ClientOptions {

View File

@ -141,7 +141,12 @@ export class CommandClient extends Client {
this.emit('commandUsed', { context: ctx })
command.execute(ctx)
} catch (e) {
if (this.texts.ERROR !== undefined) this.sendProcessedText(msg, this.texts.ERROR, Object.assign(baseReplaces, { error: e.message }))
if (this.texts.ERROR !== undefined)
return this.sendProcessedText(
msg,
this.texts.ERROR,
Object.assign(baseReplaces, { error: e.message })
)
this.emit('commandError', { command, parsed, error: e })
}
}

View File

@ -2,11 +2,11 @@ import { Client } from '../models/client.ts'
import { GuildFeatures, GuildPayload } from '../types/guild.ts'
import { PresenceUpdatePayload } from '../types/gateway.ts'
import { Base } from './base.ts'
import { Emoji } from './emoji.ts'
import { VoiceState } from './voiceState.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
@ -27,7 +27,7 @@ export class Guild extends Base {
defaultMessageNotifications?: string
explicitContentFilter?: string
roles: RolesManager
emojis?: Emoji[]
emojis: EmojisManager
features?: GuildFeatures[]
mfaLevel?: string
applicationID?: string
@ -60,8 +60,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)
if (!this.unavailable) {
this.name = data.name