LogoRobo.js
Packages@robojs/mock

TestInteractions

Class: TestInteractions

Test helper for user interactions

Constructors

new TestInteractions()

new TestInteractions(session): TestInteractions

Parameters

ParameterType
sessionSession

Returns

TestInteractions

Methods

clickButton()

clickButton(
   user, 
   messageId, 
customId): Promise<void>

Have a user click a button

Parameters

ParameterTypeDescription
userstring | MockUserUser object or username
messageIdstringMessage containing the button
customIdstringButton's custom ID

Returns

Promise<void>


conversation()

conversation(channelId, messages): Promise<void>

Simulate a conversation between users

Parameters

ParameterTypeDescription
channelIdstringThe channel to send messages to
messages{ content: string; user: string; }[]Array of {user, content} pairs

Returns

Promise<void>


invokeCommand()

invokeCommand(
   user, 
   commandName, 
options?): Promise<void>

Have a user invoke a slash command

Parameters

ParameterTypeDescription
userstring | MockUserUser object or username
commandNamestringCommand name (without slash)
options?Record<string, string | number | boolean>Optional command options

Returns

Promise<void>


sendMessage()

sendMessage(
   user, 
   channelId, 
content): Promise<void>

Have a user send a message

Parameters

ParameterTypeDescription
userstring | MockUserUser object or username
channelIdstringChannel to send to
contentstringMessage content

Returns

Promise<void>

On this page