fix: errors

This commit is contained in:
DjDeveloperr 2020-11-25 17:37:39 +05:30
parent be2945c5eb
commit 7cbf1e5151
4 changed files with 271 additions and 271 deletions

View file

@ -1,15 +1,16 @@
import { Gateway, GatewayEventHandler } from '../index.ts' import { Gateway, GatewayEventHandler } from '../index.ts'
import { Guild } from '../../structures/guild.ts' import { Guild } from '../../structures/guild.ts'
import { GuildMemberAddPayload } from "../../../mod.ts"
export const guildMemberAdd: GatewayEventHandler = async ( export const guildMemberAdd: GatewayEventHandler = async (
gateway: Gateway, gateway: Gateway,
d: d: GuildMemberAddPayload
) => { ) => {
const guild: Guild | undefined = await gateway.client.guilds.get(d.guild_id) const guild: Guild | undefined = await gateway.client.guilds.get(d.guild_id)
// Weird case, shouldn't happen // Weird case, shouldn't happen
if (guild === undefined) return if (guild === undefined) return
await guild.members.set(d.id, d) await guild.members.set(d.user.id, d)
const member = await guild.members.get(d.id) const member = await guild.members.get(d.user.id)
gateway.client.emit('guildMemberAdd', member) gateway.client.emit('guildMemberAdd', member)
} }

View file

@ -8,11 +8,10 @@ import { UserManager } from '../managers/users.ts'
import { GuildManager } from '../managers/guilds.ts' import { GuildManager } from '../managers/guilds.ts'
import { ChannelsManager } from '../managers/channels.ts' import { ChannelsManager } from '../managers/channels.ts'
import { import {
ActivityGame,
ClientActivity,
ClientPresence ClientPresence
} from '../structures/presence.ts' } from '../structures/presence.ts'
import { EmojisManager } from '../managers/emojis.ts' import { EmojisManager } from '../managers/emojis.ts'
import { ActivityGame, ClientActivity } from "../types/presence.ts"
/** Some Client Options to modify behaviour */ /** Some Client Options to modify behaviour */
export interface ClientOptions { export interface ClientOptions {

View file

@ -83,7 +83,7 @@ export class TextChannel extends Channel {
), ),
{ {
content: text, content: text,
embed: option?.embed.toJSON(), embed: option?.embed !== undefined ? option.embed.toJSON() : undefined,
file: option?.file, file: option?.file,
tts: option?.tts, tts: option?.tts,
allowed_mentions: option?.allowedMention allowed_mentions: option?.allowedMention

View file

@ -191,7 +191,7 @@ export interface GuildIntegrationsUpdatePayload {
guild_id: string guild_id: string
} }
export interface GuildMemberAddPayload { export interface GuildMemberAddPayload extends MemberPayload {
guild_id: string guild_id: string
} }