Message
Definitions
Message
| FIELD | TYPE | DESCRIPTION |
|---|---|---|
id | string | message id |
content | string | message content |
channel | Channel? | channel object |
guild | Guild? | guild object |
member | GuildMember? | guild member object |
user | User? | user object |
created_at | number? | timestamp of message creation |
updated_at | number? | timestamp of message update |
API
Create Message
POST /message.create| FIELD | TYPE | DESCRIPTION |
|---|---|---|
channel_id | string | channel id |
content | string | message content |
Send (create) a message. Returns an array of Message objects.
Get Message
POST /message.get| FIELD | TYPE | DESCRIPTION |
|---|---|---|
channel_id | string | channel id |
message_id | string | message id |
Get a message by id. Returns a Message object. Required resources: channel, user.
Delete Message
POST /message.delete| FIELD | TYPE | DESCRIPTION |
|---|---|---|
channel_id | string | channel id |
message_id | string | message id |
Delete a specific message.
Update Message
POST /message.update| FIELD | TYPE | DESCRIPTION |
|---|---|---|
channel_id | string | channel id |
message_id | string | message id |
content | string | message content |
Edit (update) a specific message.
Get Message List
POST /message.list| FIELD | TYPE | DESCRIPTION |
|---|---|---|
channel_id | string | channel id |
message_id | string | message id |
next | string? | pagination token |
direction | Direction? | query direction |
limit | number? | result limit |
order | Order? | result order |
Get the list of messages in a channel. Returns a bidirectional paginated list of Message objects. Required resource: user.
- The
nextparameter defaults to null, indicating the query starts from the latest message. In this case, thedirectionparameter can only bebefore. - The
directionparameter defaults tobefore. - The
orderparameter defaults toasc(regardless of query direction). - The default value of the
limitparameter aligns with the platform's default. If the platform API does not specify a default, it can be set independently, with a recommended value of 50. If the user-provided value exceeds the platform's limit, the platform's upper limit should be used instead of returning an error. Developers should use the presence ofprevornextin the response to determine if more data exists, rather than relying on the length of thedatain the response.
Events
message-created
Triggered when a message is created. Required resources: channel, message, user.
message-updated
Triggered when a message is updated. Required resources: channel, message, user.
message-deleted
Triggered when a message is deleted. Required resources: channel, message, user.