import { IRCMessage } from "../irc/irc-message.mjs"; import { Channel, ChannelIRCMessage } from "../irc/channel-irc-message.mjs"; import { TwitchBadgesList } from "../badges.mjs"; import { Color } from "../color.mjs"; import { TwitchEmoteList } from "../emotes.mjs"; import { TwitchFlagList } from "../flags.mjs"; import { SharedChatFields, SharedChatSource } from "../shared-chat.mjs"; import { UserState } from "./userstate.mjs"; //#region src/message/twitch-types/privmsg.d.ts declare function parseActionAndMessage(trailingParameter: string): { isAction: boolean; message: string; }; interface MessageSender { readonly login: string; /** @deprecated Use {@link MessageSender.login} instead. */ readonly username: string; readonly id: string; readonly displayName: string; readonly color: Color | undefined; readonly colorRaw: string; readonly badgeInfo: TwitchBadgesList; readonly badgeInfoRaw: string; readonly badges: TwitchBadgesList; readonly badgesRaw: string; readonly isMod: boolean; readonly isModRaw: string; } interface ReplyParent { readonly displayName: string; readonly messageBody: string; readonly messageId: string; readonly userId: string; readonly userLogin: string; } interface CheerPrivmsgMessage extends PrivmsgMessage { readonly bits: number; readonly bitsRaw: string; } interface ReplyPrivmsgMessage extends PrivmsgMessage { readonly replyParent: ReplyParent; } /** * Omits `emoteSets` and `emoteSetsRaw` from {@link UserState} (because they are not sent * for `PRIVMSG` messages) * @deprecated Use {@link PrivmsgMessage.sender} instead. */ type PrivmsgUserState = Omit; declare class PrivmsgMessage extends ChannelIRCMessage implements PrivmsgUserState, Partial { private readonly _content; private readonly _action; private readonly _senderLogin; private readonly _senderId; private readonly _badgeInfo; private readonly _badgeInfoRaw; private readonly _badges; private readonly _badgesRaw; private readonly _bits; private readonly _bitsRaw; private readonly _color; private readonly _colorRaw; private readonly _displayName; private readonly _emotes; private readonly _emotesRaw; private readonly _flags; private readonly _flagsRaw; private readonly _replyParentDisplayName; private readonly _replyParentMessageBody; private readonly _replyParentMessageId; private readonly _replyParentUserId; private readonly _replyParentUserLogin; private readonly _id; private readonly _isMod; private readonly _isModRaw; private readonly _channelRoomId; private readonly _timestamp; private readonly _timestampRaw; private readonly _sourceId; private readonly _sourceChannelId; private readonly _sourceBadges; private readonly _sourceBadgesRaw; private readonly _sourceBadgeInfo; private readonly _sourceBadgeInfoRaw; get isAction(): boolean; get content(): string; /** * The id of the message. * @example "7eb848c9-1060-4e5e-9f4c-612877982e79" */ get id(): string; /** * 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. */ get timestamp(): Date; get timestampRaw(): string; get bits(): number | undefined; get bitsRaw(): string | undefined; get emotes(): TwitchEmoteList; get emotesRaw(): string; /** * 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`. */ get flags(): TwitchFlagList | undefined; /** * 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. */ get flagsRaw(): string | undefined; get channel(): Channel & { readonly id: string; }; get sender(): MessageSender; get replyParent(): ReplyParent | undefined; get source(): SharedChatSource | undefined; /** @deprecated Use {@link content} instead. */ get messageText(): string; /** @deprecated Use {@link sender.login} instead. */ get senderUsername(): string; /** @deprecated Use {@link sender.id} instead. */ get senderUserID(): string; /** @deprecated Use {@link sender.id} instead. */ get senderUserId(): string; /** @deprecated Use {@link sender.badgeInfo} instead. */ get badgeInfo(): TwitchBadgesList; /** @deprecated Use {@link sender.badgeInfoRaw} instead. */ get badgeInfoRaw(): string; /** @deprecated Use {@link sender.badges} instead. */ get badges(): TwitchBadgesList; /** @deprecated Use {@link sender.badgesRaw} instead. */ get badgesRaw(): string; /** @deprecated Use {@link sender.color} instead. */ get color(): Color | undefined; /** @deprecated Use {@link sender.colorRaw} instead. */ get colorRaw(): string; /** @deprecated Use {@link sender.displayName} instead. */ get displayName(): string; /** @deprecated Use {@link id} instead. */ get messageID(): string; /** @deprecated Use {@link id} instead. */ get messageId(): string; /** @deprecated Use {@link sender.isMod} instead. */ get isMod(): boolean; /** @deprecated Use {@link sender.isModRaw} instead. */ get isModRaw(): string; /** @deprecated Use {@link channel.id} instead. */ get channelID(): string; /** @deprecated Use {@link timestamp} instead. */ get serverTimestamp(): Date; /** @deprecated Use {@link timestampRaw} instead. */ get serverTimestampRaw(): string; /** @deprecated Use {@link replyParent.displayName} instead. */ get replyParentDisplayName(): string | undefined; /** @deprecated Use {@link replyParent.messageBody} instead. */ get replyParentMessageBody(): string | undefined; /** @deprecated Use {@link replyParent.messageId} instead. */ get replyParentMessageID(): string | undefined; /** @deprecated Use {@link replyParent.userId} instead. */ get replyParentUserID(): string | undefined; /** @deprecated Use {@link replyParent.userLogin} instead. */ get replyParentUserLogin(): string | undefined; /** @deprecated Use {@link source.id} instead. */ get sourceID(): string | undefined; /** @deprecated Use {@link source.channelID} instead. */ get sourceChannelID(): string | undefined; /** @deprecated Use {@link source.badges} instead. */ get sourceBadges(): TwitchBadgesList | undefined; /** @deprecated Use {@link source.badgesRaw} instead. */ get sourceBadgesRaw(): string | undefined; /** @deprecated Use {@link source.badgeInfo} instead. */ get sourceBadgesInfo(): TwitchBadgesList | undefined; /** @deprecated Use {@link source.badgeInfoRaw} instead. */ get sourceBadgesInfoRaw(): string | undefined; constructor(ircMessage: IRCMessage); /** * @deprecated Use {@link sender} instead. */ extractUserState(): PrivmsgUserState; isCheer(): this is CheerPrivmsgMessage; isReply(): this is ReplyPrivmsgMessage; /** * 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 * @see https://dev.twitch.tv/docs/chat/irc/#shared-chat */ isSharedChat(): this is this & SharedChatFields; } //#endregion export { MessageSender, PrivmsgMessage, PrivmsgUserState, ReplyParent, parseActionAndMessage }; //# sourceMappingURL=privmsg.d.mts.map