Package blue.starry.penicillin.endpoints.directmessages.events

Functions

Link copied to clipboard
fun DirectMessageEvents.create(    userId: Long,     text: String,     type: String = "message_create",     vararg options: Option): JsonObjectApiAction<DirectMessageEvent.Show>

Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user. Returns an event if successful. Supports publishing Direct Messages with optional Quick Reply and media attachment. Replaces behavior currently provided by POST direct_messages/new. Requires a JSON POST body and Content-Type header to be set to application/json. Setting Content-Length may also be required if it is not automatically.

Link copied to clipboard
fun DirectMessageEvents.delete(id: String, vararg options: Option): EmptyApiAction

Deletes the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message. Direct Messages are only removed from the interface of the user context provided. Other members of the conversation can still access the Direct Messages. A successful delete will return a 204 http response code with no body content. Important: This method requires an access token with RWD (read, write & direct message) permissions.

Link copied to clipboard
fun DirectMessageEvents.list(    count: Int? = null,     cursor: String? = null,     vararg options: Option): JsonObjectApiAction<DirectMessageEvent.List>

Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order.

Link copied to clipboard
fun DirectMessageEvents.show(id: String, vararg options: Option): JsonObjectApiAction<DirectMessageEvent.Show>

Returns a single Direct Message event by the given id.

Properties

Link copied to clipboard