var trigger = context_menu_user(Args{command_name: "Get User Info"})
func main() {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "User ID: " + trigger.user_id,
})
}
User Context Menu
Triggers when a user runs a context menu command on a user.
- Interaction trigger: the flow can reply to the user directly, with messages, modals and more.
Options
The name of the context menu command (1-32 chars).
Example: Get User Info
Permissions a member needs to use this command. Leave empty to allow everyone.
Outputs
ID of the user who ran the command.
Example: 123456789012345678
Username of the user who ran the command.
Example: johndoe
Avatar URL of the user who ran the command.
Example: https://cdn.discordapp.com/avatars/123/abc.png
Channel where the command was used.
Example: 123456789012345678
Server where the command was used.
Example: 123456789012345678
ID of the application that received this interaction.
Example: 123456789012345678
ID of the context menu command that Discord invoked.
Example: 123456789012345678
Unique interaction ID for this command invocation.
Example: 123456789012345678
Token for this interaction, useful for webhook follow-up/edit operations.
Example: aW50ZXJhY3Rpb25fdG9rZW4
Permissions the bot/application had in the interaction channel, as a Discord bitfield string.
Example: 274877990912
Discord locale of the user who ran the command.
Example: en-US
Preferred locale of the server where the command was used, when available.
Example: en-US
Where the interaction was used (`server`, `bot_dm`, or `private_channel`).
Example: server
ID of the user the command was used on.
Example: 123456789012345678
Username of the user the command was used on.
Example: JaneDoe
Avatar URL of the user the command was used on.
Example: https://cdn.discordapp.com/avatars/456/def.png
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
context_menu_user- Interaction trigger: blocks that respond to interactions (replies, modals, ...) can be used in its flows.
Options
| Field | InventScript name | Value |
|---|---|---|
| Command Name | command_name | e.g. "Get User Info" |
| Required Permissions | default_member_permissions | "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
| Field | InventScript name | Value |
|---|---|---|
| User ID | user_id | e.g. "123456789012345678" |
| Username | username | e.g. "johndoe" |
| User Avatar URL | user_avatar | e.g. "https://cdn.discordapp.com/avatars/123/abc.png" |
| Channel ID | channel_id | e.g. "123456789012345678" |
| Server ID | server_id | e.g. "123456789012345678" |
| Application ID | application_id | e.g. "123456789012345678" |
| Command ID | command_id | e.g. "123456789012345678" |
| Interaction ID | interaction_id | e.g. "123456789012345678" |
| Interaction Token | interaction_token | e.g. "aW50ZXJhY3Rpb25fdG9rZW4" |
| App Permissions | app_permissions | e.g. "274877990912" |
| User Locale | user_locale | e.g. "en-US" |
| Server Locale | server_locale | e.g. "en-US" |
| Interaction Context | interaction_context | e.g. "server" |
| Target User ID | target_user_id | e.g. "123456789012345678" |
| Target Username | target_username | e.g. "JaneDoe" |
| Target User Avatar URL | target_user_avatar | e.g. "https://cdn.discordapp.com/avatars/456/def.png" |