Skip to content
GitHub

ResponseReport

interface in meocord/testing Since 4.1.0

interface ResponseReport

How an interaction was answered, as getResponse reports it.

Members

state

state: ResponsePhase

Where the answer stands: 'unanswered', 'deferred' or 'replied'.

sent

sent: boolean

Whether anything the user can see was sent: a reply, an update, an edit or a follow-up that Discord accepted.

calls

calls: readonly (
  | (ResponseCall & {
      method: 'reply' | 'followUp'
      payload?: string | MessagePayload | InteractionReplyOptions
    })
  | (ResponseCall & {
      method: 'update'
      payload?: string | MessagePayload | InteractionUpdateOptions
    })
  | (ResponseCall & {
      method: 'editReply'
      payload?: string | MessagePayload | InteractionEditReplyOptions
    })
  | (ResponseCall & {
      method: 'message.edit'
      payload?: string | MessagePayload | MessageEditOptions
    })
  | (ResponseCall & {
      method: 'showModal'
      payload?:
        | JSONEncodable<APIModalInteractionResponseCallbackData>
        | ModalComponentData
        | APIModalInteractionResponseCallbackData
    })
  | (ResponseCall & {
      method: 'deferReply'
      payload?: InteractionDeferReplyOptions
    })
  | (ResponseCall & {
      method: 'deferUpdate'
      payload?: InteractionDeferUpdateOptions
    })
  | (ResponseCall & {
      method: 'deleteReply'
      payload?: MessageResolvable | '@original'
    })
)[]

Every answer call the interaction got, through respond() or discord.js directly, in order: the payload it sent, without withResponse, and the error of one Discord refused. Checking a call's method types its payload as that method takes it: the options of a reply, an edit or a deferral, the modal shown, or the message deleted.