Skip to main content

Message, Messages, and Uploads

Import these classes from talos-fluxer. Uploads is also exported from talos-fluxer/uploads. See message examples.

Message

Usually returned by a send, fetch, or messageCreate event. The constructor is new Message(data, messages), where messages is a Messages manager. reply accepts text or MessageCreate; edit accepts text or MessageEdit. Both support files through SendOptions. Other methods accept operation options. An edit does not mutate the existing object’s data.

Messages

Available as client.messages or resources.messages. For REST-only code, use new Messages(rest). See the source and query types. list uses API query fields, including a string page limit. history accepts a numeric total limit, fetches pages of up to 100, and stops fetching when you leave the loop. Send and edit options accept files in addition to signal, timeoutMs, and reason. multipart(body, files) is the separate helper used to build a multipart body; it is a function, not a class. You usually do not need it when using this manager.

Uploads

Available as client.uploads. For standalone code, construct new Uploads(rest, { fetch?, concurrency? }?). Transfer concurrency defaults to four. The fetch override handles upload transfers separately from REST. Each file needs data: Blob and name; description is optional. Options accept signal, timeoutMs, and onProgress({ completedBytes, totalBytes }). The default deadline is five minutes. Progress counts completed transfers rather than individual network chunks. This method does not send a message. Pass its returned descriptors as attachments to Messages.send(). Alternatively, pass files directly to send for the multipart message flow. See the upload source and UploadError.