Skip to content

@mastondzn/dank-twitch-irc / PrivmsgMessage

Class: PrivmsgMessage

Defined in: src/message/twitch-types/privmsg.ts:74

Extends

Implements

Constructors

Constructor

new PrivmsgMessage(ircMessage): PrivmsgMessage

Defined in: src/message/twitch-types/privmsg.ts:381

Parameters

ircMessage

IRCMessage

Returns

PrivmsgMessage

Overrides

ChannelIRCMessage.constructor

Properties

_channelLogin

protected readonly _channelLogin: string

Defined in: src/message/irc/channel-irc-message.ts:41

Inherited from

ChannelIRCMessage._channelLogin


ircCommand

readonly ircCommand: string

Defined in: src/message/irc/irc-message.ts:28

The parser ensures this is always uppercase

Inherited from

ChannelIRCMessage.ircCommand


ircParameters

readonly ircParameters: string[]

Defined in: src/message/irc/irc-message.ts:29

Inherited from

ChannelIRCMessage.ircParameters


ircPrefix

readonly ircPrefix: IRCMessagePrefix | undefined

Defined in: src/message/irc/irc-message.ts:23

Inherited from

ChannelIRCMessage.ircPrefix


ircPrefixRaw

readonly ircPrefixRaw: string | undefined

Defined in: src/message/irc/irc-message.ts:22

Inherited from

ChannelIRCMessage.ircPrefixRaw


ircTags

readonly ircTags: IRCMessageTags

Defined in: src/message/irc/irc-message.ts:30

Inherited from

ChannelIRCMessage.ircTags


rawSource

readonly rawSource: string

Defined in: src/message/irc/irc-message.ts:20

Inherited from

ChannelIRCMessage.rawSource

Accessors

badgeInfo

Get Signature

get badgeInfo(): TwitchBadgesList

Defined in: src/message/twitch-types/privmsg.ts:257

Deprecated

Use sender.badgeInfo instead.

Returns

TwitchBadgesList

Implementation of

UserState.badgeInfo


badgeInfoRaw

Get Signature

get badgeInfoRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:262

Deprecated

Use sender.badgeInfoRaw instead.

Returns

string

Implementation of

UserState.badgeInfoRaw


badges

Get Signature

get badges(): TwitchBadgesList

Defined in: src/message/twitch-types/privmsg.ts:267

Deprecated

Use sender.badges instead.

Returns

TwitchBadgesList

Implementation of

UserState.badges


badgesRaw

Get Signature

get badgesRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:272

Deprecated

Use sender.badgesRaw instead.

Returns

string

Implementation of

UserState.badgesRaw


bits

Get Signature

get bits(): number | undefined

Defined in: src/message/twitch-types/privmsg.ts:142

Returns

number | undefined


bitsRaw

Get Signature

get bitsRaw(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:146

Returns

string | undefined


channel

Get Signature

get channel(): Channel & object

Defined in: src/message/twitch-types/privmsg.ts:186

Returns

Channel & object

Overrides

ChannelIRCMessage.channel


channelID

Get Signature

get channelID(): string

Defined in: src/message/twitch-types/privmsg.ts:312

Deprecated

Use channel.id instead.

Returns

string


channelName

Get Signature

get channelName(): string

Defined in: src/message/irc/channel-irc-message.ts:51

Deprecated

Use channel.login instead.

Returns

string

Inherited from

ChannelIRCMessage.channelName


color

Get Signature

get color(): Color | undefined

Defined in: src/message/twitch-types/privmsg.ts:277

Deprecated

Use sender.color instead.

Returns

Color | undefined

Implementation of

UserState.color


colorRaw

Get Signature

get colorRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:282

Deprecated

Use sender.colorRaw instead.

Returns

string

Implementation of

UserState.colorRaw


content

Get Signature

get content(): string

Defined in: src/message/twitch-types/privmsg.ts:118

Returns

string


displayName

Get Signature

get displayName(): string

Defined in: src/message/twitch-types/privmsg.ts:287

Deprecated

Use sender.displayName instead.

Returns

string

Implementation of

UserState.displayName


emotes

Get Signature

get emotes(): TwitchEmoteList

Defined in: src/message/twitch-types/privmsg.ts:150

Returns

TwitchEmoteList


emotesRaw

Get Signature

get emotesRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:154

Returns

string


flags

Get Signature

get flags(): TwitchFlagList | undefined

Defined in: src/message/twitch-types/privmsg.ts:169

Can be an array of Twitch AutoMod flagged words, for use in moderation and/or filtering purposes.

If the flags tag is missing or of a unparseable format, this will be undefined. This is unlike most other attributes which when missing or malformed will fail the message parsing. However since this attribute is completely undocumented we cannot rely on the flags tag being stable, so this soft fallback is used instead. While it will be a major version release if this attribute changes format in dank-twitch-irc, using this is still at your own risk since it may suddenly contain unexpected data or turn undefined one day as Twitch changes something. In short: Use at your own risk and make sure your implementation can handle the case where this is undefined.

Returns

TwitchFlagList | undefined


flagsRaw

Get Signature

get flagsRaw(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:182

Twitch AutoMod raw flags string.

If the flags tag is missing or of a unparseable format, this will be undefined. This is unlike most other attributes which when missing or malformed will fail the message parsing. However since this attribute is completely undocumented we cannot rely on the flags tag being stable, so this soft fallback is used instead. In short, ensure your implementation can handle the case where this is undefined or is in a format you don't expect.

Returns

string | undefined


id

Get Signature

get id(): string

Defined in: src/message/twitch-types/privmsg.ts:126

The id of the message.

Example
ts
"7eb848c9-1060-4e5e-9f4c-612877982e79"
Returns

string


isAction

Get Signature

get isAction(): boolean

Defined in: src/message/twitch-types/privmsg.ts:114

Returns

boolean


isMod

Get Signature

get isMod(): boolean

Defined in: src/message/twitch-types/privmsg.ts:302

Deprecated

Use sender.isMod instead.

Returns

boolean

Implementation of

UserState.isMod


isModRaw

Get Signature

get isModRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:307

Deprecated

Use sender.isModRaw instead.

Returns

string

Implementation of

UserState.isModRaw


messageId

Get Signature

get messageId(): string

Defined in: src/message/twitch-types/privmsg.ts:297

Deprecated

Use id instead.

Returns

string


messageID

Get Signature

get messageID(): string

Defined in: src/message/twitch-types/privmsg.ts:292

Deprecated

Use id instead.

Returns

string


messageText

Get Signature

get messageText(): string

Defined in: src/message/twitch-types/privmsg.ts:237

Deprecated

Use content instead.

Returns

string


replyParent

Get Signature

get replyParent(): ReplyParent | undefined

Defined in: src/message/twitch-types/privmsg.ts:211

Returns

ReplyParent | undefined


replyParentDisplayName

Get Signature

get replyParentDisplayName(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:327

Deprecated

Use replyParent.displayName instead.

Returns

string | undefined


replyParentMessageBody

Get Signature

get replyParentMessageBody(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:332

Deprecated

Use replyParent.messageBody instead.

Returns

string | undefined


replyParentMessageID

Get Signature

get replyParentMessageID(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:337

Deprecated

Use replyParent.messageId instead.

Returns

string | undefined


replyParentUserID

Get Signature

get replyParentUserID(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:342

Deprecated

Use replyParent.userId instead.

Returns

string | undefined


replyParentUserLogin

Get Signature

get replyParentUserLogin(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:347

Deprecated

Use replyParent.userLogin instead.

Returns

string | undefined


sender

Get Signature

get sender(): MessageSender

Defined in: src/message/twitch-types/privmsg.ts:194

Returns

MessageSender


senderUserId

Get Signature

get senderUserId(): string

Defined in: src/message/twitch-types/privmsg.ts:252

Deprecated

Use sender.id instead.

Returns

string


senderUserID

Get Signature

get senderUserID(): string

Defined in: src/message/twitch-types/privmsg.ts:247

Deprecated

Use sender.id instead.

Returns

string


senderUsername

Get Signature

get senderUsername(): string

Defined in: src/message/twitch-types/privmsg.ts:242

Deprecated

Use sender.login instead.

Returns

string


serverTimestamp

Get Signature

get serverTimestamp(): Date

Defined in: src/message/twitch-types/privmsg.ts:317

Deprecated

Use timestamp instead.

Returns

Date


serverTimestampRaw

Get Signature

get serverTimestampRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:322

Deprecated

Use timestampRaw instead.

Returns

string


source

Get Signature

get source(): SharedChatSource | undefined

Defined in: src/message/twitch-types/privmsg.ts:222

Returns

SharedChatSource | undefined


sourceBadges

Get Signature

get sourceBadges(): TwitchBadgesList | undefined

Defined in: src/message/twitch-types/privmsg.ts:362

Deprecated

Use source.badges instead.

Returns

TwitchBadgesList | undefined

Implementation of

SharedChatFields.sourceBadges


sourceBadgesInfo

Get Signature

get sourceBadgesInfo(): TwitchBadgesList | undefined

Defined in: src/message/twitch-types/privmsg.ts:372

Deprecated

Use source.badgeInfo instead.

Returns

TwitchBadgesList | undefined

Implementation of

SharedChatFields.sourceBadgesInfo


sourceBadgesInfoRaw

Get Signature

get sourceBadgesInfoRaw(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:377

Deprecated

Use source.badgeInfoRaw instead.

Returns

string | undefined

Implementation of

SharedChatFields.sourceBadgesInfoRaw


sourceBadgesRaw

Get Signature

get sourceBadgesRaw(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:367

Deprecated

Use source.badgesRaw instead.

Returns

string | undefined

Implementation of

SharedChatFields.sourceBadgesRaw


sourceChannelID

Get Signature

get sourceChannelID(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:357

Deprecated

Use source.channelID instead.

Returns

string | undefined

Implementation of

SharedChatFields.sourceChannelID


sourceID

Get Signature

get sourceID(): string | undefined

Defined in: src/message/twitch-types/privmsg.ts:352

Deprecated

Use source.id instead.

Returns

string | undefined

Implementation of

SharedChatFields.sourceID


timestamp

Get Signature

get timestamp(): Date

Defined in: src/message/twitch-types/privmsg.ts:134

The timestamp of when the message was sent, as reported by Twitch. This is not necessarily the same as the time the message was received by your client.

Returns

Date


timestampRaw

Get Signature

get timestampRaw(): string

Defined in: src/message/twitch-types/privmsg.ts:138

Returns

string

Methods

extractUserState()

extractUserState(): PrivmsgUserState

Defined in: src/message/twitch-types/privmsg.ts:446

Returns

PrivmsgUserState

Deprecated

Use sender instead.


isCheer()

isCheer(): this is CheerPrivmsgMessage

Defined in: src/message/twitch-types/privmsg.ts:460

Returns

this is CheerPrivmsgMessage


isReply()

isReply(): this is ReplyPrivmsgMessage

Defined in: src/message/twitch-types/privmsg.ts:464

Returns

this is ReplyPrivmsgMessage


isSharedChat()

isSharedChat(): this is PrivmsgMessage & SharedChatFields

Defined in: src/message/twitch-types/privmsg.ts:475

Whether or not this message is during a shared chat session. This does NOT necessarily mean that the message is originating from another channel. Check if message.source.channelId !== message.channel.id for that

Returns

this is PrivmsgMessage & SharedChatFields

See

https://dev.twitch.tv/docs/chat/irc/#shared-chat