var trigger = dm_message_create()
func main() {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Message Content: " + trigger.content,
})
}
DM Message Sent
Event triggerMessages
Triggers when a direct message is sent to the bot.
Message content will be empty without message content intent. Does not trigger for bot messages.
Outputs
Message Content
The content of the DM that was sent
Example: Hello world!
Message ID
The unique ID of the message
Example: 123456789012345678
Channel ID
The ID of the DM channel
Example: 123456789012345678
Author ID
The ID of the user who sent the DM
Example: 123456789012345678
User Mentions
Comma-separated list of mentioned user IDs
Example: 123456789012345678,987654321098765432
Message Sent At (Unix)
Unix timestamp when the message was sent
Example: 1640995200
Build a bot using triggers like DM Message Sent
Use this trigger in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
ID:
dm_message_createOutputs
| Field | InventScript name | Value |
|---|---|---|
| Message Content | content | e.g. "Hello world!" |
| Message ID | message_id | e.g. "123456789012345678" |
| Channel ID | channel_id | e.g. "123456789012345678" |
| Author ID | author_id | e.g. "123456789012345678" |
| User Mentions | user_mentions | e.g. "123456789012345678,987654321098765432" |
| Message Sent At (Unix) | message_sent_at | e.g. "1640995200" |
Example InventScript
More messages triggers
Message SentTriggers when a message is sent.Message CommandTriggers when a message command (like !help) is sent.Message Sent by BotTriggers when a message is sent by a bot.Message EditedTriggers when a message is edited.Message Edited by BotTriggers when a message is edited by a bot.Message DeletedTriggers when a message is deleted.Message Delete BulkTriggers when messages are deleted in bulk.Poll Vote AddedTriggers when a user votes in a poll.Poll Vote RemovedTriggers when a user removes their vote in a poll.