Yor.ts | classes/Member
Class: Member
Hierarchy
-
↳
Member
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new Member(client
, guildID
, member
): Member
Constructs a new instance of the constructor.
Parameters
Name | Type | Description |
---|---|---|
client | YorClient | The client object. |
guildID | string | The ID of the guild. |
member | APIInteractionGuildMember | The member object. |
Returns
Overrides
Defined in
Properties
API
• Private
API: GuildsAPI
Defined in
client
• client: YorClient
Inherited from
Defined in
joinedTimestamp
• Optional
joinedTimestamp: number
Defined in
nickname
• Optional
nickname: string
Defined in
raw
• raw: APIInteractionGuildMember
& { guildID
: string
}
Defined in
user
• user: User
Defined in
Methods
ban
▸ ban(data?
): Promise
<void
>
Bans a user with optional additional data.
Parameters
Name | Type | Description |
---|---|---|
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
displayName
▸ displayName(): string
Returns the display name for the member.
Returns
string
The display name of the member.
Defined in
edit
▸ edit(data
): Promise
<APIGuildMember
>
Edits a guild member.
Parameters
Name | Type | Description |
---|---|---|
data | RESTPatchAPIGuildMemberJSONBody & { 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
fetchGuild
▸ fetchGuild(): Promise
<Guild
>
Fetches a guild using the guild ID.
Returns
A Promise that resolves with the fetched Guild object.
Defined in
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
kick
▸ kick(reason?
): Promise
<unknown
>
Kick a member from the guild.
Parameters
Name | Type | Description |
---|---|---|
reason? | string | The reason for the kick, optional. |
Returns
Promise
<unknown
>
A promise that resolves with the result of the kick.
Defined in
Was this page helpful?