Properties
jid
Deprecated
Alias of chatId.chatId
senderId
ctx.senderId).
isGroup
displayName
ctx.senderInfo.displayName).
Methods
send()
Parameters
Returns
Promise<void>
sendLocation()
Call Signature
ctx.sharedLocation, c.waitLocation()).
Parameters
Returns
Promise<void>
Call Signature
Parameters
Returns
Promise<void>
sendMedia()
ctx.body is the caption, loadMediaOf(ctx) resolves
with the bytes. A { url } source without bytes makes the download reject with
MediaUnavailableError (the mock never touches the network).
Parameters
Returns
Promise<void>
sendReaction()
bot.on('reaction'), 'reaction' hooks). Default target: the bot’s
last message in this chat, else the user’s last message. { removed: true } retracts it.
Parameters
Returns
Promise<void>
sendInteraction()
provider.interaction): data is what ctx.body / ctx.interaction.data carry.
Parameters
Returns
Promise<void>
pressButton()
'buttons' message whose body is the id).
Parameters
Returns
Promise<PressedButton>
expectReply()
matcher (already sent or arriving before the timeout).
Parameters
Returns
Promise<string>
expectNoReply()
timeout (default 300 ms); reject listing the unexpected replies. Consumes nothing.
Parameters
Returns
Promise<void>
replies()
Returns
string[]
sent()
ref.
Returns
TestSent[]
lastReply()
Returns
TestSent | undefined
transcript()
Call Signature
recordTranscript
produces: it parses, redacts and replays with assertTranscript). Deterministic by
default (no ids, no timestamps), so it fits toMatchSnapshot().
Parameters
Returns
string
Call Signature
Parameters
Returns
Transcript
as()
Parameters
Returns
TestChat