GuildAnnouncementChannel
Represents a guild announcement channel.
Extends
BaseGuildTextChannel
<ChannelType.GuildAnnouncement
,IsPartial
>
Type Parameters
Type Parameter | Default type |
---|---|
IsPartial extends boolean | false |
Constructors
new GuildAnnouncementChannel()
new GuildAnnouncementChannel<
IsPartial
>(client
,rawDataOrId
):GuildAnnouncementChannel
<IsPartial
>
Parameters
Parameter | Type |
---|---|
client | Client |
rawDataOrId | IsPartial extends true ? string : APINewsChannel |
Returns
GuildAnnouncementChannel
<IsPartial
>
Inherited from
BaseGuildTextChannel
.constructor
Properties
Property | Modifier | Type | Description | Overrides | Inherited from |
---|---|---|---|---|---|
client | public | Client | - | - | BaseGuildTextChannel .client |
id | readonly | string | The id of the channel. | - | BaseGuildTextChannel .id |
rawData | public | null | APIGuildTextChannel <GuildAnnouncement > | The raw data of the channel. | BaseGuildTextChannel .rawData | - |
Accessors
flags
get
flags():IfPartial
<IsPartial
,undefined
|ChannelFlags
>
The flags of the channel in a bitfield.
See
https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
Returns
IfPartial
<IsPartial
, undefined
| ChannelFlags
>
Inherited from
guild
The guild this channel is in
Returns
IfPartial
<IsPartial
, Guild
<true
>>
Inherited from
guildId
get
guildId():IfPartial
<IsPartial
,string
>
The ID of the guild this channel is in
Returns
IfPartial
<IsPartial
, string
>
Inherited from
lastMessage
get
lastMessage():IfPartial
<IsPartial
,null
|Message
<true
>>
The last message sent in the channel.
Remarks
This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted. This will always return a partial message, so you can use Message.fetch to get the full message data.
Returns
IfPartial
<IsPartial
, null
| Message
<true
>>
Inherited from
BaseGuildTextChannel
.lastMessage
lastMessageId
get
lastMessageId():IfPartial
<IsPartial
,null
|string
>
The ID of the last message sent in the channel.
Remarks
This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
Returns
IfPartial
<IsPartial
, null
| string
>
Inherited from
BaseGuildTextChannel
.lastMessageId
lastPinTimestamp
get
lastPinTimestamp():IfPartial
<IsPartial
,null
|string
>
The timestamp of the last pin in the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
Inherited from
BaseGuildTextChannel
.lastPinTimestamp
name
get
name():IfPartial
<IsPartial
,string
>
The name of the channel.
Returns
IfPartial
<IsPartial
, string
>
Inherited from
nsfw
get
nsfw():IfPartial
<IsPartial
,boolean
>
Whether the channel is marked as nsfw.
Returns
IfPartial
<IsPartial
, boolean
>
Inherited from
parentId
get
parentId():IfPartial
<IsPartial
,null
|string
>
The ID of the parent category for the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
Inherited from
partial
get
partial():IsPartial
Whether the channel is a partial channel (meaning it does not have all the data). If this is true, you should use BaseChannel.fetch to get the full data of the channel.
Returns
IsPartial
Inherited from
position
get
position():IfPartial
<IsPartial
,number
>
The position of the channel in the channel list.
Returns
IfPartial
<IsPartial
, number
>
Inherited from
rateLimitPerUser
get
rateLimitPerUser():IfPartial
<IsPartial
,undefined
|number
>
The rate limit per user for the channel, in seconds.
Returns
IfPartial
<IsPartial
, undefined
| number
>
Inherited from
BaseGuildTextChannel
.rateLimitPerUser
topic
get
topic():IfPartial
<IsPartial
,null
|string
>
The topic of the channel.
Returns
IfPartial
<IsPartial
, null
| string
>
Inherited from
type
get
type():IfPartial
<IsPartial
,Type
>
The type of the channel.
Returns
IfPartial
<IsPartial
, Type
>
Inherited from
Methods
createInvite()
createInvite(
options
?):Promise
<APIExtendedInvite
>
Create an invite for the channel
Parameters
Parameter | Type |
---|---|
options ? | RESTPostAPIChannelInviteJSONBody |
Returns
Promise
<APIExtendedInvite
>
Inherited from
BaseGuildTextChannel
.createInvite
fetch()
fetch():
Promise
<void
>
Fetches the channel from the API.
Returns
Promise
<void
>
The channel data.
Inherited from
follow()
follow(
targetChannel
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
targetChannel | string | GuildTextChannel <false > |
Returns
Promise
<void
>
getInvites()
getInvites():
Promise
<RESTGetAPIGuildInvitesResult
>
Get the invites for the channel
Returns
Promise
<RESTGetAPIGuildInvitesResult
>
Inherited from
BaseGuildTextChannel
.getInvites
getPinnedMessages()
Get the pinned messages in the channel
Returns
Inherited from
BaseGuildTextChannel
.getPinnedMessages
send()
send(
message
):Promise
<void
>
Send a message to the channel
Parameters
Parameter | Type |
---|---|
message | MessagePayload |
Returns
Promise
<void
>
Inherited from
setData()
protected
setData(data
):void
Parameters
Parameter | Type |
---|---|
data | APINewsChannel |
Returns
void
Inherited from
setField()
protected
setField(field
,value
):void
Parameters
Parameter | Type |
---|---|
field | "id" | "name" | "rate_limit_per_user" | "last_message_id" | "last_pin_timestamp" | "type" | "flags" | "guild_id" | "permission_overwrites" | "position" | "parent_id" | "nsfw" | "topic" | "default_auto_archive_duration" | "default_thread_rate_limit_per_user" |
value | unknown |
Returns
void
Inherited from
setName()
setName(
name
):Promise
<void
>
Set the name of the channel
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The new name of the channel |
Returns
Promise
<void
>
Inherited from
setNsfw()
setNsfw(
nsfw
):Promise
<void
>
Set whether the channel is nsfw
Parameters
Parameter | Type | Description |
---|---|---|
nsfw | boolean | The new nsfw status of the channel |
Returns
Promise
<void
>
Inherited from
setParent()
setParent(
parent
):Promise
<void
>
Set the parent ID of the channel
Parameters
Parameter | Type | Description |
---|---|---|
parent | string | GuildCategoryChannel <false > | The new category channel or ID to set |
Returns
Promise
<void
>
Inherited from
BaseGuildTextChannel
.setParent
setPosition()
setPosition(
position
):Promise
<void
>
Set the position of the channel
Parameters
Parameter | Type | Description |
---|---|---|
position | number | The new position of the channel |
Returns
Promise
<void
>
Inherited from
BaseGuildTextChannel
.setPosition
startThread()
startThread(
data
):Promise
<GuildThreadChannel
<ThreadChannelType
,false
>>
Start a thread without an associated start message. If you want to start a thread with a start message, use Message.startThread
Parameters
Parameter | Type |
---|---|
data | RESTPostAPIChannelThreadsJSONBody |
Returns
Promise
<GuildThreadChannel
<ThreadChannelType
, false
>>
Inherited from
BaseGuildTextChannel
.startThread
triggerTyping()
triggerTyping():
Promise
<void
>
Trigger a typing indicator in the channel (this will expire after 10 seconds)
Returns
Promise
<void
>