Skip to content
GitHub

MessageToResolve

interface in meocord/testing Since 4.1.0

interface MessageToResolve

A message, as resolveRoute takes it.

Members

content

content: string

The message's text, prefix included.

prefix

prefix?: MessagePrefix

The 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?: string

The bot's user id, so a mention of it counts as a start when the app accepts one.

dm

dm?: boolean

Whether 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.