Title: ContextMenu commands gets registered globally when registering commands for a sepecific guild. · Issue #2414 · DSharpPlus/DSharpPlus · GitHub
Open Graph Title: ContextMenu commands gets registered globally when registering commands for a sepecific guild. · Issue #2414 · DSharpPlus/DSharpPlus
X Title: ContextMenu commands gets registered globally when registering commands for a sepecific guild. · Issue #2414 · DSharpPlus/DSharpPlus
Description: Summary When I pass a guildId to the AddCommands call, the context menu command gets registered globally. **Note: ** Normal commands gets registered for the specific guild as expected. What version of the library are you using? v5.0.0-ni...
Open Graph Description: Summary When I pass a guildId to the AddCommands call, the context menu command gets registered globally. **Note: ** Normal commands gets registered for the specific guild as expected. What version...
X Description: Summary When I pass a guildId to the AddCommands call, the context menu command gets registered globally. **Note: ** Normal commands gets registered for the specific guild as expected. What version...
Opengraph URL: https://github.com/DSharpPlus/DSharpPlus/issues/2414
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ContextMenu commands gets registered globally when registering commands for a sepecific guild.","articleBody":"### Summary\n\nWhen I pass a guildId to the `AddCommands` call, the context menu command gets registered globally.\n**Note: ** Normal commands gets registered for the specific guild as expected.\n\n### What version of the library are you using?\n\nv5.0.0-nightly (make sure you are using the latest nightly!)\n\n### What .NET version are you using? Make sure to use the latest patch release for your major version.\n\n.NET 9.0\n\n### Operating System\n\nwsl, ubuntu\n\n### Reproduction Steps\n\n```cs\nusing DSharpPlus;\nusing DSharpPlus.Commands;\nusing DSharpPlus.Commands.Processors.SlashCommands;\nusing DSharpPlus.Entities;\n\nvar token = \u003cbot-token\u003e;\nulong guildId = \u003cyour-guild-id\u003e;\n\nvar builder = DiscordClientBuilder.CreateDefault(token, DiscordIntents.All);\nbuilder.UseCommands(\n (serviceProvider, extension) =\u003e\n {\n extension.AddCommands([typeof(ReplyCommand)], guildId);\n }\n);\n\nDiscordClient client = builder.Build();\nawait client.ConnectAsync();\n\nvar globalCommands = await client.GetGlobalApplicationCommandsAsync();\nConsole.WriteLine($\"Global Commands count: {globalCommands.Count}\");\n\nawait Task.Delay(-1);\n\ninternal class ReplyCommand\n{\n [Command(\"reply\")]\n [SlashCommandTypes(DiscordApplicationCommandType.MessageContextMenu)]\n public static async ValueTask ReplyAsync(CommandContext context, DiscordMessage message)\n {\n await message.RespondAsync(\"Replied to the message.\");\n }\n}\n```\n\n### Trace Logs\n\n```log\n[2026-02-10 19:28:58 +00:00] [DSharpPlus.DiscordClient] [Info] DSharpPlus; version 5.0.0-nightly-02569+97b5788a92dd56e9a0ce210387627c785abefa6b\n[2026-02-10 19:28:59 +00:00] [DSharpPlus.Commands.Processors.BaseCommandProcessor] [Info] Detected changes in slash command records: 0 without changes, 1 added, 0 edited, 0 deleted\n[2026-02-10 19:28:59 +00:00] [DSharpPlus.Commands.Processors.BaseCommandProcessor] [Info] Registered 1 top-level slash commands, 1 total slash commands.\nGlobal Commands count: 1\n```\n\n### Exceptions or other error messages\n\n```txt\n\n```\n\n### Anything else you'd like to share\n\n_No response_","author":{"url":"https://github.com/hmd-ali","@type":"Person","name":"hmd-ali"},"datePublished":"2026-02-10T19:34:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2414/DSharpPlus/issues/2414"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:80d5d02e-d67d-e9c4-66d2-67b597ce0790 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 815A:31D948:23D8D5C:317B0FD:698CE2E1 |
| html-safe-nonce | 7bd555ae03d230140f718ad7106b53b2a99d3d968d12493f0343233cc6655dd0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTVBOjMxRDk0ODoyM0Q4RDVDOjMxN0IwRkQ6Njk4Q0UyRTEiLCJ2aXNpdG9yX2lkIjoiODc0MjQ4NzExNjI1MDY2OTc5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b53c637f059e1f4ab47148c17610ec9f1d58b08f8b6c90f1d03e1cd3ece9fabd |
| hovercard-subject-tag | issue:3923197726 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/DSharpPlus/DSharpPlus/2414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/500ec41f7c09155952faf18c35383502b259fd48ea5de767a210263a99a3c984/DSharpPlus/DSharpPlus/issues/2414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/500ec41f7c09155952faf18c35383502b259fd48ea5de767a210263a99a3c984/DSharpPlus/DSharpPlus/issues/2414 |
| og:image:alt | Summary When I pass a guildId to the AddCommands call, the context menu command gets registered globally. **Note: ** Normal commands gets registered for the specific guild as expected. What version... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hmd-ali |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/DSharpPlus/DSharpPlus git https://github.com/DSharpPlus/DSharpPlus.git |
| octolytics-dimension-user_id | 36208721 |
| octolytics-dimension-user_login | DSharpPlus |
| octolytics-dimension-repository_id | 67243489 |
| octolytics-dimension-repository_nwo | DSharpPlus/DSharpPlus |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 67243489 |
| octolytics-dimension-repository_network_root_nwo | DSharpPlus/DSharpPlus |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width