# Message Command

> Triggers when a message command (like !help) is sent.

- ID: `message_command`
- Type: Event trigger
- Category: [Messages](https://inventor.bot/docs/reference/triggers/messages.md)

> Needs message content intent in servers unless the only prefix is MENTION. Does not trigger for bot messages.

**Options**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `prefixes` | yes | Comma-separated list of prefixes. Use `MENTION` for a mention of this bot. | e.g. `"!,MENTION"` |
| `command_name` | yes | The command name that follows the prefix (case-insensitive). Up to one space is allowed between the prefix and the name. | e.g. `"help"` |
| `command_availability` |  | Where the command can be used. Defaults to Servers if empty. | `"Servers"`, `"Direct Messages"`, `"Both"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `content` | The full content of the message | e.g. `"!ban @user spamming"` |
| `prefix` | The prefix that matched, as written in the Prefixes input (`MENTION` for a mention of this bot) | e.g. `"!"` |
| `command_name` | The command name from the Command Name input | e.g. `"ban"` |
| `arguments` | Everything after the command name and the space following it | e.g. `"@user spamming"` |
| `message_id` | The unique ID of the message | e.g. `"123456789012345678"` |
| `channel_id` | The ID of the channel where the message was sent | e.g. `"123456789012345678"` |
| `author_id` | The ID of the user who sent the message | e.g. `"123456789012345678"` |
| `server_id` | The ID of the server where the message was sent, empty in DMs | e.g. `"123456789012345678"` |
| `user_mentions` | Comma-separated list of mentioned user IDs, including this bot when the MENTION prefix was used | e.g. `"123456789012345678,987654321098765432"` |
| `role_mentions` | Comma-separated list of mentioned role IDs | e.g. `"123456789012345678,987654321098765432"` |
| `message_sent_at` | Unix timestamp when the message was sent | e.g. `"1640995200"` |

**Example**

```go
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,
	})
}
```