hoshii / Exports / ChatMessage
ChatMessage<T>
Represents a chat message
Type parameters
Name | Type |
---|---|
T | extends AnyTextableChannel = AnyTextableChannel |
Hierarchy
Base
<string
>↳
ChatMessage
Table of contents
Constructors
Properties
- _cachedChannel
- _cachedServer
- channelID
- client
- content
- createdAt
- createdBy
- createdByWebhookID
- deletedAt
- embeds
- id
- isPrivate
- isSilent
- mentions
- replyMessageIDs
- serverID
- type
- updatedAt
Accessors
Methods
Constructors
constructor
• new ChatMessage<T
>(data
, client
)
Create a new ChatMessage
Type parameters
Name | Type |
---|---|
T | extends TextChannel <T > = TextChannel |
Parameters
Name | Type | Description |
---|---|---|
data | RawChatMessage | The raw data of the message |
client | Client | The client |
Overrides
Defined in
lib/structures/ChatMessage.ts:161
Properties
_cachedChannel
• Private
_cachedChannel: T
extends TextChannel
? T
: undefined
The cached channel the message is in
Defined in
lib/structures/ChatMessage.ts:79
_cachedServer
• Private
Optional
_cachedServer: T
extends Server
? Server
: Server
The cached server that created the message
Defined in
lib/structures/ChatMessage.ts:84
channelID
• channelID: string
The ID of the channel the message is in
Defined in
lib/structures/ChatMessage.ts:89
client
• client: Client
The bot client
Inherited from
Defined in
content
• Optional
content: string
The content of the message
Defined in
lib/structures/ChatMessage.ts:94
createdAt
• createdAt: Date
The date the message was created at
Defined in
lib/structures/ChatMessage.ts:99
createdBy
• createdBy: string
The ID of the user who created the message
Defined in
lib/structures/ChatMessage.ts:104
createdByWebhookID
• Optional
createdByWebhookID: string
The ID of the webhook that created the message
Defined in
lib/structures/ChatMessage.ts:109
deletedAt
• deletedAt: Date
The date the message was deleted
Defined in
lib/structures/ChatMessage.ts:114
embeds
• Optional
embeds: [] | ChatEmbedOptions
[]
An array of embeds in the message
Defined in
lib/structures/ChatMessage.ts:119
id
• id: string
The ID of the item
Inherited from
Defined in
isPrivate
• isPrivate: boolean
Whether the message is private
Defined in
lib/structures/ChatMessage.ts:124
isSilent
• isSilent: boolean
Whether the message is a silent reply
Defined in
lib/structures/ChatMessage.ts:129
mentions
• mentions: Mentions
An object of mentions in the message
Defined in
lib/structures/ChatMessage.ts:134
replyMessageIDs
• replyMessageIDs: string
[]
An array of message IDs that this message is replying to
Defined in
lib/structures/ChatMessage.ts:139
serverID
• serverID: string
The ID of the server the message is in
Defined in
lib/structures/ChatMessage.ts:144
type
• type: MessageCategories
The type of message
Defined in
lib/structures/ChatMessage.ts:149
updatedAt
• updatedAt: Date
The date the message was updated at
Defined in
lib/structures/ChatMessage.ts:154
Accessors
channel
• get
channel(): T
extends TextChannel
? T
: undefined
The channel the message is in
Returns
T
extends TextChannel
? T
: undefined
Defined in
lib/structures/ChatMessage.ts:185
member
• get
member(): T
extends Server
? ServerMember
: ServerMember
| Promise
<ServerMember
>
The kmember that created the message
Returns
T
extends Server
? ServerMember
: ServerMember
| Promise
<ServerMember
>
Defined in
lib/structures/ChatMessage.ts:229
server
• get
server(): T
extends Server
? Server
: Server
The server the message is in
Returns
T
extends Server
? Server
: Server
Defined in
lib/structures/ChatMessage.ts:207
Methods
addReactionEmote
▸ addReactionEmote(emoteID
): Promise
<void
>
Add a reaction emote to the message
Parameters
Name | Type | Description |
---|---|---|
emoteID | number | The ID of the emote |
Returns
Promise
<void
>
Defined in
lib/structures/ChatMessage.ts:278
delete
▸ delete(): Promise
<void
>
Delete the message
Returns
Promise
<void
>
Defined in
lib/structures/ChatMessage.ts:286
deleteReactionEmote
▸ deleteReactionEmote(emoteID
): Promise
<void
>
Delete a reaction emote from the message
Parameters
Name | Type | Description |
---|---|---|
emoteID | number | The ID of the emote |
Returns
Promise
<void
>
Defined in
lib/structures/ChatMessage.ts:295
edit
▸ edit<T
>(options
): Promise
<ChatMessage
<T
>>
Edit the message
Type parameters
Name | Type |
---|---|
T | extends TextChannel <T > = TextChannel |
Parameters
Name | Type | Description |
---|---|---|
options | MessageEditOptions | The options to edit the message with |
Returns
Promise
<ChatMessage
<T
>>
Defined in
lib/structures/ChatMessage.ts:308
setCache
▸ Private
setCache(obj
): Promise
<void
>
Parameters
Name | Type |
---|---|
obj | Promise <ServerMember > | Promise <Server > |
Returns
Promise
<void
>
Defined in
lib/structures/ChatMessage.ts:314
toJSON
▸ toJSON(): ChatMessageData
Returns the JSON representation of the item
Returns
Overrides
Defined in
lib/structures/ChatMessage.ts:331
update
▸ Protected
update(data
): void
Parameters
Name | Type |
---|---|
data | RawChatMessage |
Returns
void