import { KBotify } from '../..'; import { AppCommand } from '../command/command.app'; import { BaseObject } from '../base/bot.object'; import { Channel } from '../channel'; import { ButtonEventMessage, TextMessage } from '../message'; import { SendOptions } from '../msg.types'; import { ResultTypes } from '../types'; import { BaseUser } from '../user'; import { BaseData, FuncResult } from '../command/types'; import { MenuCommand } from '../command/command.menu'; import { Card, CardObject } from '../card'; import { Guild } from '../guild'; import { SessionSendFunc } from './session.type'; export declare class BaseSession extends BaseObject implements BaseData { /** * 命令字符串 */ cmdString?: string | undefined; command: AppCommand | MenuCommand; args: string[]; msg: ButtonEventMessage | TextMessage; channel: Channel; content: string | undefined; guild?: Guild; other?: any; /** * 会话的用户ID。 * 如果是文字消息,则返回发送者ID,如果是按钮事件,则返回点击者ID。 * * @type {string} * @memberof BaseSession */ userId: string; user: BaseUser; constructor(command: AppCommand | MenuCommand, args: string[], msg: ButtonEventMessage | TextMessage, client?: KBotify); get guildId(): string | undefined; reply: SessionSendFunc; replyTemp: SessionSendFunc; replyCard: (content: string | (() => string) | (() => Promise) | CardObject[] | Card, options?: Omit | undefined) => Promise>; replyCardTemp: (content: string | (() => string) | (() => Promise) | CardObject[] | Card, options?: Omit | undefined) => Promise>; /** * Send message with quotation (no @ included) */ quote: SessionSendFunc; /** * Send temporary message with quotation (no @ included) */ quoteTemp: SessionSendFunc; mention: SessionSendFunc; mentionTemp: SessionSendFunc; send: SessionSendFunc; sendTemp: SessionSendFunc; sendCard: (content: string | (() => string) | (() => Promise) | CardObject[] | Card, options?: SendOptions | undefined) => Promise>; sendCardTemp: (content: string | (() => string) | (() => Promise) | CardObject[] | Card, options?: Omit | undefined) => Promise>; /** * * @param messageId * @param content * @param quote */ updateMessage: (messageId: string, content: string | CardObject[], quote?: string | undefined, tempTargetId?: string | undefined) => Promise>; /** * * @param messageId * @param content * @param quote */ updateMessageTemp: (messageId: string, content: string | CardObject[], quote?: string | undefined) => Promise>; /** * 设置文字回复触发事件 * * @param condition 文字满足的要求,包含的文字或正则表达式 * @param timeout 单位:ms 回复触发有效时间,默认为1分钟 * @param callback 触发后的回调函数 * @returns */ setTextTrigger: (condition: string | RegExp, timeout: number | null | undefined, callback: (msg: TextMessage) => void) => () => void; /** * 发送消息。 * ### 接收 * 如果接收的消息为文字消息,则可以使用引用和@。 * 如果接收的消息为按钮点击事件消息,则可以使用@。 * ### 发送 * 如果发送的消息为文字或kmarkdown,则可以使用引用和@。 * 如果发送的消息为卡片消息,则可以使用引用。 * * @param content * @param [resultType=ResultTypes.SUCCESS] * @param [sendOptions] * @memberof BaseSession */ _send: (content: string | (() => string) | string | (() => Promise), resultType?: ResultTypes, sendOptions?: SendOptions | undefined) => Promise; private readonly _sendCard; }