Guild
Extends
Base
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
Constructor
new Guild<
IsPartial
>(client
,rawDataOrId
):Guild
<IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : APIGuild |
Returns
Guild
<IsPartial
>
Overrides
Base.constructor
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
client | public | Client | - | Base.client |
id | readonly | string | The ID of the guild | - |
Accessors
description
Get Signature
get description():
IfPartial
<IsPartial
,null
|string
>
The description of the guild.
Returns
IfPartial
<IsPartial
, null
| string
>
icon
Get Signature
get icon():
IfPartial
<IsPartial
,null
|string
>
The icon hash of the guild. You can use Guild.iconUrl to get the URL of the icon.
Returns
IfPartial
<IsPartial
, null
| string
>
iconUrl
Get Signature
get iconUrl():
IfPartial
<IsPartial
,null
|string
>
Get the URL of the guild's icon
Returns
IfPartial
<IsPartial
, null
| string
>
name
Get Signature
get name():
IfPartial
<IsPartial
,string
>
The name of the guild.
Returns
IfPartial
<IsPartial
, string
>
ownerId
Get Signature
get ownerId():
IfPartial
<IsPartial
,string
>
The ID of the owner of the guild.
Returns
IfPartial
<IsPartial
, string
>
partial
Get Signature
get partial():
IfPartial
<IsPartial
,false
,true
>
Whether the guild is a partial guild (meaning it does not have all the data). If this is true, you should use Guild.fetch to get the full data of the guild.
Returns
IfPartial
<IsPartial
, false
, true
>
roles
Get Signature
Get all roles in the guild
Returns
IfPartial
<IsPartial
, Role
<false
>[]>
splash
Get Signature
get splash():
IfPartial
<IsPartial
,null
|string
>
The splash hash of the guild. You can use Guild.splashUrl to get the URL of the splash.
Returns
IfPartial
<IsPartial
, null
| string
>
splashUrl
Get Signature
get splashUrl():
IfPartial
<IsPartial
,null
|string
>
Get the URL of the guild's splash
Returns
IfPartial
<IsPartial
, null
| string
>
Methods
createRole()
Create a role in the guild
Parameters
Parameter | Type |
---|---|
data | RESTPostAPIGuildRoleJSONBody |
Returns
fetch()
fetch():
Promise
<Guild
<false
>>
Fetch updated data for this guild. If the guild is partial, this will fetch all the data for the guild and populate the fields. If the guild is not partial, all fields will be updated with new values from Discord.
Returns
Promise
<Guild
<false
>>
A Promise that resolves to a non-partial Guild
fetchChannel()
fetchChannel(
channelId
):Promise
<null
|DmChannel
<false
> |GroupDmChannel
<false
> |GuildTextChannel
<false
> |GuildVoiceChannel
<false
> |GuildCategoryChannel
<false
> |GuildAnnouncementChannel
<false
> |GuildThreadChannel
<ThreadChannelType
,false
> |GuildStageChannel
<false
> |GuildForumChannel
<false
> |GuildMediaChannel
>
Fetch a channel from the guild by ID
Parameters
Parameter | Type |
---|---|
channelId | string |
Returns
Promise
<null
| DmChannel
<false
> | GroupDmChannel
<false
> | GuildTextChannel
<false
> | GuildVoiceChannel
<false
> | GuildCategoryChannel
<false
> | GuildAnnouncementChannel
<false
> | GuildThreadChannel
<ThreadChannelType
, false
> | GuildStageChannel
<false
> | GuildForumChannel
<false
> | GuildMediaChannel
>
fetchMember()
fetchMember(
memberId
):Promise
<GuildMember
<false
,IsPartial
>>
Get a member in the guild by ID
Parameters
Parameter | Type |
---|---|
memberId | string |
Returns
Promise
<GuildMember
<false
, IsPartial
>>
leave()
leave():
Promise
<unknown
>
Leave the guild
Returns
Promise
<unknown
>