fix: errors
This commit is contained in:
parent
be2945c5eb
commit
7cbf1e5151
4 changed files with 271 additions and 271 deletions
|
@ -1,15 +1,16 @@
|
|||
import { Gateway, GatewayEventHandler } from '../index.ts'
|
||||
import { Guild } from '../../structures/guild.ts'
|
||||
import { GuildMemberAddPayload } from "../../../mod.ts"
|
||||
|
||||
export const guildMemberAdd: GatewayEventHandler = async (
|
||||
gateway: Gateway,
|
||||
d:
|
||||
d: GuildMemberAddPayload
|
||||
) => {
|
||||
const guild: Guild | undefined = await gateway.client.guilds.get(d.guild_id)
|
||||
// Weird case, shouldn't happen
|
||||
if (guild === undefined) return
|
||||
|
||||
await guild.members.set(d.id, d)
|
||||
const member = await guild.members.get(d.id)
|
||||
await guild.members.set(d.user.id, d)
|
||||
const member = await guild.members.get(d.user.id)
|
||||
gateway.client.emit('guildMemberAdd', member)
|
||||
}
|
|
@ -8,11 +8,10 @@ import { UserManager } from '../managers/users.ts'
|
|||
import { GuildManager } from '../managers/guilds.ts'
|
||||
import { ChannelsManager } from '../managers/channels.ts'
|
||||
import {
|
||||
ActivityGame,
|
||||
ClientActivity,
|
||||
ClientPresence
|
||||
} from '../structures/presence.ts'
|
||||
import { EmojisManager } from '../managers/emojis.ts'
|
||||
import { ActivityGame, ClientActivity } from "../types/presence.ts"
|
||||
|
||||
/** Some Client Options to modify behaviour */
|
||||
export interface ClientOptions {
|
||||
|
|
|
@ -83,7 +83,7 @@ export class TextChannel extends Channel {
|
|||
),
|
||||
{
|
||||
content: text,
|
||||
embed: option?.embed.toJSON(),
|
||||
embed: option?.embed !== undefined ? option.embed.toJSON() : undefined,
|
||||
file: option?.file,
|
||||
tts: option?.tts,
|
||||
allowed_mentions: option?.allowedMention
|
||||
|
|
|
@ -191,7 +191,7 @@ export interface GuildIntegrationsUpdatePayload {
|
|||
guild_id: string
|
||||
}
|
||||
|
||||
export interface GuildMemberAddPayload {
|
||||
export interface GuildMemberAddPayload extends MemberPayload {
|
||||
guild_id: string
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue