MessageToResolve
interface in meocord/testing Since 4.1.0
interface MessageToResolveA message, as resolveRoute takes it.
Members
content
content: stringThe message's text, prefix included.
prefix
prefix?: MessagePrefixThe prefix this message has, for an app that reads prefixes from a function; ignored otherwise unless given, when it stands in for the app's.
botId
botId?: stringThe bot's user id, so a mention of it counts as a start when the app accepts one.
dm
dm?: booleanWhether the message is a direct message, where mention: 'only' does not apply, and a handler that works only in
a server, by its scope or a member, role or channel param in its pattern, is not reached, as dispatch never
runs it: it answers "This command works in a server only." to a message sent with a prefix or a mention, and
nothing to one without, which may be chat. Under useStrictMocks() a handler with a required flag of those types,
or one the message gives, is not reached either, as dispatch refuses it the same way; default mode resolves it,
with a warning. Without it, a mention alone starts what it starts in a server, and a handler of any scope may
answer, with a warning where one that works only in a DM does. Under useStrictMocks(), the message is read as
sent in a server, as dispatch reads one: such a handler is passed over for one that works there, or resolves to
undefined.