Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Some IDiscordClient methods are not properly implemented in clients #2774

Conversation

Panthr75
Copy link
Contributor

Description

Fixes some bugs related to IDiscordClient methods not being properly implemented in RestClient, SocketClient, and ShardedSocketClient due to BaseDiscordClient "blankly" implementing them.

Changes

  • Added CreateGlobalApplicationCommandAsync and BulkOverwriteGlobalApplicationCommandsAsync to ShardedSocketClient
  • ShardedSocketClient properly implements IDiscordClient.BulkOverwriteGlobalApplicationCommand and CreateGlobalApplicationCommand
  • SocketClient properly implements IDiscordClient.BulkOverwriteGlobalApplicationCommand and CreateGlobalApplicationCommand
  • RestClient properly implements IDiscordClient.BulkOverwriteGlobalApplicationCommand and CreateGlobalApplicationCommand

Related Issues

  • Bulk Overriding Global Commands does not work with IDiscordClient

System.Diagnostics.Debug.Assert(entity != null, "There should be at least one shard to get the entity");

//Update it in case it was cached
entity.Update(model);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would happen if the command is cached in multiple shard states? it would be updated in only one shard with this impl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to all shards. I wonder though if I should return the last entity (like the current implementation).

@Misha-133 Misha-133 merged commit 8baf913 into discord-net:dev Sep 15, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants