Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseSession

Hierarchy

Implements

Index

Constructors

constructor

Properties

args

args: string[]

channel

channel: Channel

client

client: KBotify

Optional cmdString

cmdString: string

命令字符串

command

content

content: undefined | string

Optional guild

guild: Guild

mention

mention: SessionSendFunc = ...

mentionTemp

mentionTemp: SessionSendFunc = ...

msg

Optional other

other: any

quote

quote: SessionSendFunc = ...

Send message with quotation (no @ included)

quoteTemp

quoteTemp: SessionSendFunc = ...

Send temporary message with quotation (no @ included)

reply

reply: SessionSendFunc = ...

replyTemp

replyTemp: SessionSendFunc = ...

send

send: SessionSendFunc = ...

sendTemp

sendTemp: SessionSendFunc = ...

user

user: BaseUser

userId

userId: string

会话的用户ID。 如果是文字消息,则返回发送者ID,如果是按钮事件,则返回点击者ID。

memberof

BaseSession

Accessors

_botInstance

guildId

  • get guildId(): undefined | string

Methods

_send

  • 发送消息。

    接收

    如果接收的消息为文字消息,则可以使用引用和@。 如果接收的消息为按钮点击事件消息,则可以使用@。

    发送

    如果发送的消息为文字或kmarkdown,则可以使用引用和@。 如果发送的消息为卡片消息,则可以使用引用。

    memberof

    BaseSession

    Parameters

    • content: string | (() => string) | (() => Promise<string>)
    • resultType: ResultTypes = ...
    • Optional sendOptions: SendOptions

    Returns Promise<FuncResult<any>>

Private Readonly _sendCard

getBotInstance

replyCard

replyCardTemp

sendCard

sendCardTemp

setTextTrigger

  • setTextTrigger(condition: string | RegExp, timeout?: null | number, callback: (msg: TextMessage) => void): () => void
  • 设置文字回复触发事件

    Parameters

    • condition: string | RegExp

      文字满足的要求,包含的文字或正则表达式

    • timeout: null | number = 6e4

      单位:ms 回复触发有效时间,默认为1分钟

    • callback: (msg: TextMessage) => void

      触发后的回调函数

    Returns () => void

      • (): void
      • Returns void

updateMessage

  • updateMessage(messageId: string, content: string | CardObject[], quote?: string, tempTargetId?: string): Promise<FuncResult<boolean>>

updateMessageTemp

  • updateMessageTemp(messageId: string, content: string | CardObject[], quote?: string): Promise<FuncResult<boolean>>

Generated using TypeDoc