# Message Context Menu

> Triggers when a user runs a context menu command on a message.

- ID: `context_menu_message`
- Type: Interaction trigger
- Category: [Interactions](https://inventor.bot/docs/reference/triggers/interactions.md)

- Interaction trigger: blocks that respond to interactions (replies, modals, ...) can be used in its flows.

**Options**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `command_name` | yes | The name of the context menu command (1-32 chars). | e.g. `"Report Message"` |
| `default_member_permissions` |  | Permissions a member needs to use this command. Leave empty to allow everyone. | `"Add Reactions"`, `"Administrator"`, `"Attach Files"`, `"Ban Members"`, `"Bypass Slowmode"`, `"Change Nickname"`, `"Connect"`, `"Create Events"`, `"Create Expressions"`, `"Create Instant Invite"`, `"Create Private Threads"`, `"Create Public Threads"`, `"Deafen Members"`, `"Embed Links"`, `"Kick Members"`, `"Manage Channels"`, `"Manage Emojis"`, `"Manage Events"`, `"Manage Messages"`, `"Manage Nicknames"`, `"Manage Roles"`, `"Manage Server"`, `"Manage Threads"`, `"Manage Webhooks"`, `"Mention Everyone"`, `"Move Members"`, `"Mute Members"`, `"Pin Messages"`, `"Priority Speaker"`, `"Read Message History"`, `"Request to Speak"`, `"Send Messages"`, `"Send Messages in Threads"`, `"Send Polls"`, `"Send TTS Messages"`, `"Send Voice Messages"`, `"Set Voice Channel Status"`, `"Speak"`, `"Stream"`, `"Timeout Members"`, `"Use Application Commands"`, `"Use Embedded Activities"`, `"Use External Apps"`, `"Use External Emojis"`, `"Use External Sounds"`, `"Use External Stickers"`, `"Use Soundboard"`, `"Use VAD"`, `"View Audit Log"`, `"View Channel"`, `"View Creator Monetization Analytics"`, `"View Guild Insights"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `user_id` | ID of the user who ran the command. | e.g. `"123456789012345678"` |
| `username` | Username of the user who ran the command. | e.g. `"johndoe"` |
| `user_avatar` | Avatar URL of the user who ran the command. | e.g. `"https://cdn.discordapp.com/avatars/123/abc.png"` |
| `channel_id` | Channel where the command was used. | e.g. `"123456789012345678"` |
| `server_id` | Server where the command was used. | e.g. `"123456789012345678"` |
| `application_id` | ID of the application that received this interaction. | e.g. `"123456789012345678"` |
| `command_id` | ID of the context menu command that Discord invoked. | e.g. `"123456789012345678"` |
| `interaction_id` | Unique interaction ID for this command invocation. | e.g. `"123456789012345678"` |
| `interaction_token` | Token for this interaction, useful for webhook follow-up/edit operations. | e.g. `"aW50ZXJhY3Rpb25fdG9rZW4"` |
| `app_permissions` | Permissions the bot/application had in the interaction channel, as a Discord bitfield string. | e.g. `"274877990912"` |
| `user_locale` | Discord locale of the user who ran the command. | e.g. `"en-US"` |
| `server_locale` | Preferred locale of the server where the command was used, when available. | e.g. `"en-US"` |
| `interaction_context` | Where the interaction was used (`server`, `bot_dm`, or `private_channel`). | e.g. `"server"` |
| `target_message_id` | ID of the message the command was used on. | e.g. `"123456789012345678"` |
| `target_message_content` | Content of the message the command was used on. | e.g. `"Hello world!"` |
| `target_message_author_id` | ID of the author of the message the command was used on. | e.g. `"123456789012345678"` |
| `target_channel_id` | Channel ID of the message the command was used on, when available. | e.g. `"123456789012345678"` |
| `target_server_id` | Server ID of the message the command was used on, when available. | e.g. `"123456789012345678"` |

**Example**

```go
var trigger = context_menu_message(Args{command_name: "Report Message"})

func main() {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "User ID: " + trigger.user_id,
	})
}
```