@@ -154,6 +154,79 @@ This only works for [message commands](./04-message-commands.mdx).
154154 </TabItem >
155155</Tabs >
156156
157+ ### ` nameAliases `
158+
159+ This is a way to use a different context menu command name from the
160+ one defined in your ` command ` object. This is helpful when you want a
161+ different name compared to your chat input or message command while
162+ still using the same command file to handle them.
163+
164+ :::warning
165+
166+ When the
167+ [ @commandkit/i18n ] ( ../05-official-plugins/05-commandkit-i18n.mdx )
168+ plugin is in use and a translation for the context menu command is
169+ provided, this option will be ignored.
170+
171+ :::
172+
173+ <Tabs >
174+ <TabItem value = " ts" label = " TypeScript" default >
175+ ``` ts title="src/app/commands/avatar.ts"
176+ export const command: CommandData = {
177+ name: ' avatar'
178+ }
179+
180+ export const metadata: CommandMetadata = {
181+ nameAliases: {
182+ message: ' author-avatar' ,
183+ user: ' profile-picture'
184+ }
185+ };
186+
187+ // this slash command will run using the name `avatar`
188+ export const chatInput: ChatInputCommand = () => {};
189+
190+ // this message command will run using the name `avatar`
191+ export const message: MessageCommand = () => {};
192+
193+ // this message context menu command will run using the name `author-avatar`
194+ export const messageContextMenu: MessageContextMenuCommand = () => {};
195+
196+ // this user context menu command will run using the name `profile-picture`
197+ export const userContextMenu: UserContextMenuCommand = () => {};
198+ ```
199+
200+ </TabItem >
201+ <TabItem value = " js" label = " JavaScript" >
202+ ``` js title="src/app/commands/avatar.js"
203+ export const command = {
204+ name: ' avatar'
205+ }
206+
207+ export const metadata = {
208+ nameAliases: {
209+ message: ' author-avatar' ,
210+ user: ' profile-picture'
211+ }
212+ };
213+
214+ // this slash command will run using the name `avatar`
215+ export const chatInput = () => {};
216+
217+ // this message command will run using the name `avatar`
218+ export const message = () => {};
219+
220+ // this message context menu command will run using the name `author-avatar`
221+ export const messageContextMenu = () => {};
222+
223+ // this user context menu command will run using the name `profile-picture`
224+ export const userContextMenu = () => {};
225+ ```
226+
227+ </TabItem >
228+ </Tabs >
229+
157230## Generated metadata
158231
159232If you'd like to generate metadata dynamically, you can export a
0 commit comments