var trigger = message_command(Args{prefixes: "!,MENTION", command_name: "help"})
func main() {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Message Content: " + trigger.content,
})
}
Message Command
Triggers when a message command (like !help) is sent.
Options
Comma-separated list of prefixes. Use `MENTION` for a mention of this bot.
Example: !,MENTION
The command name that follows the prefix (case-insensitive). Up to one space is allowed between the prefix and the name.
Example: help
Where the command can be used. Defaults to Servers if empty.
Outputs
The full content of the message
Example: !ban @user spamming
The prefix that matched, as written in the Prefixes input (`MENTION` for a mention of this bot)
Example: !
The command name from the Command Name input
Example: ban
Everything after the command name and the space following it
Example: @user spamming
The unique ID of the message
Example: 123456789012345678
The ID of the channel where the message was sent
Example: 123456789012345678
The ID of the user who sent the message
Example: 123456789012345678
The ID of the server where the message was sent, empty in DMs
Example: 123456789012345678
Comma-separated list of mentioned user IDs, including this bot when the MENTION prefix was used
Example: 123456789012345678,987654321098765432
Comma-separated list of mentioned role IDs
Example: 123456789012345678,987654321098765432
Unix timestamp when the message was sent
Example: 1640995200
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
message_commandOptions
| Field | InventScript name | Value |
|---|---|---|
| Prefixes | prefixes | e.g. "!,MENTION" |
| Command Name | command_name | e.g. "help" |
| Command Availability | command_availability | "Servers", "Direct Messages", "Both" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Message Content | content | e.g. "!ban @user spamming" |
| Prefix | prefix | e.g. "!" |
| Command Name | command_name | e.g. "ban" |
| Arguments | arguments | e.g. "@user spamming" |
| Message ID | message_id | e.g. "123456789012345678" |
| Channel ID | channel_id | e.g. "123456789012345678" |
| Author ID | author_id | e.g. "123456789012345678" |
| Server ID | server_id | e.g. "123456789012345678" |
| User Mentions | user_mentions | e.g. "123456789012345678,987654321098765432" |
| Role Mentions | role_mentions | e.g. "123456789012345678,987654321098765432" |
| Message Sent At (Unix) | message_sent_at | e.g. "1640995200" |