Guild
Extends
Base
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
new Guild()
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
description():IfPartial
<IsPartial
,null
|string
>
The description of the guild.
Returns
IfPartial
<IsPartial
, null
| string
>
icon
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
iconUrl():IfPartial
<IsPartial
,null
|string
>
Get the URL of the guild's icon
Returns
IfPartial
<IsPartial
, null
| string
>
name
get
name():IfPartial
<IsPartial
,string
>
The name of the guild.
Returns
IfPartial
<IsPartial
, string
>
ownerId
get
ownerId():IfPartial
<IsPartial
,string
>
The ID of the owner of the guild.
Returns
IfPartial
<IsPartial
, string
>
partial
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 all roles in the guild
Returns
IfPartial
<IsPartial
, Role
<false
>[]>
splash
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
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
<void
>
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
<void
>
fetchChannel()
fetchChannel(
channelId
):Promise
<null
|GuildCategoryChannel
<false
> |DmChannel
<false
> |GroupDmChannel
<false
> |GuildTextChannel
<false
> |GuildVoiceChannel
<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
| GuildCategoryChannel
<false
> | DmChannel
<false
> | GroupDmChannel
<false
> | GuildTextChannel
<false
> | GuildVoiceChannel
<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
>