yor.ts / Exports / Member

Class: Member

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Member(client, guildID, member): Member

Constructs a new instance of the constructor.

Parameters

NameTypeDescription
clientYorClientThe client object.
guildIDstringThe ID of the guild.
memberAPIInteractionGuildMemberThe member object.

Returns

Member

Overrides

Base.constructor

Defined in

src/structures/Member.ts:29

Properties

API

Private API: GuildsAPI

Defined in

src/structures/Member.ts:15


client

client: YorClient

Inherited from

Base.client

Defined in

src/structures/Base.ts:4


joinedTimestamp

Optional joinedTimestamp: number

Defined in

src/structures/Member.ts:20


nickname

Optional nickname: string

Defined in

src/structures/Member.ts:19


raw

raw: APIInteractionGuildMember & { guildID: string }

Defined in

src/structures/Member.ts:17


user

user: User

Defined in

src/structures/Member.ts:18

Methods

ban

ban(data?): Promise<void>

Bans a user with optional additional data.

Parameters

NameTypeDescription
data?RESTPutAPIGuildBanJSONBody & { reason: string }The optional additional data for banning the user. It can include properties like delete_message_seconds and reason.

Returns

Promise<void>

A promise that resolves when the user is successfully banned.

Defined in

src/structures/Member.ts:51


displayName

displayName(): string

Returns the display name for the member.

Returns

string

The display name of the member.

Defined in

src/structures/Member.ts:99


edit

edit(data): Promise<APIGuildMember>

Edits a guild member.

Parameters

NameTypeDescription
dataRESTPatchAPIGuildMemberJSONBody & { reason?: string }The data to edit the guild member with. It should include the reason as a string if provided.

Returns

Promise<APIGuildMember>

A promise that resolves with the edited guild member object.

Defined in

src/structures/Member.ts:109


fetchGuild

fetchGuild(): Promise<Guild>

Fetches a guild using the guild ID.

Returns

Promise<Guild>

A Promise that resolves with the fetched Guild object.

Defined in

src/structures/Member.ts:81


joinedAt

joinedAt(): undefined | Date

Returns the joined date of the user as a Date object.

Returns

undefined | Date

  • The joined date of the user, or undefined if the joined timestamp is not set.

Defined in

src/structures/Member.ts:90


kick

kick(reason?): Promise<unknown>

Kick a member from the guild.

Parameters

NameTypeDescription
reason?stringThe reason for the kick, optional.

Returns

Promise<unknown>

A promise that resolves with the result of the kick.

Defined in

src/structures/Member.ts:68