You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An issue that many bot developers looking for zero downtime will run into is the 1-hour period it takes for Discord to roll out application command updates. In the event of a breaking change the developer has to either keep the old callbacks until the change has propagated or the new and be unable to use the old commands until the client receives the new.
The fix to this issue is application command overloading. With this feature, both the old and new callbacks can be deployed and the library will automatically match the correct callback.
Description
Scope
The point of this feature is not yet to allow dispatching different callbacks based on received arguments for the same command. Therefore, there is no guarantee in the order of how callbacks are tried because they're assumed to be incompatible so that there is no ambiguity.
Usage
In general there's two APIs that this can take depending on implementation details:
Registered application commands with the same name
The first alternative is that two or more callbacks are registered with the same name. This would make the overloading implicit:
The downside of this is that a new keyword-argument will have to be added which marks the primary command that gets synchronized and migrated.
.overload() decorator
The second option is a new decorator on an application command object that registers the overload. This alternative would fix the issue of marking the primary callback because the primary callback would be the original one:
The downside to this depends on implementation details. If the application command object has to be re-created because the overload functionality is in another class then it would be poor code-architecture to have the application command object do this itself.
Tasks
Add overloading functionality to existing application command objects
Alternatively, create a new class that has this functionality
Write up tests ro ensure the correct callback is dispatched as would be expected
Document overloading and how to roll out updated using this feature (see the documentation repository)
The text was updated successfully, but these errors were encountered:
Summary
An issue that many bot developers looking for zero downtime will run into is the 1-hour period it takes for Discord to roll out application command updates. In the event of a breaking change the developer has to either keep the old callbacks until the change has propagated or the new and be unable to use the old commands until the client receives the new.
The fix to this issue is application command overloading. With this feature, both the old and new callbacks can be deployed and the library will automatically match the correct callback.
Description
Scope
The point of this feature is not yet to allow dispatching different callbacks based on received arguments for the same command. Therefore, there is no guarantee in the order of how callbacks are tried because they're assumed to be incompatible so that there is no ambiguity.
Usage
In general there's two APIs that this can take depending on implementation details:
Registered application commands with the same name
The first alternative is that two or more callbacks are registered with the same name. This would make the overloading implicit:
The downside of this is that a new keyword-argument will have to be added which marks the primary command that gets synchronized and migrated.
.overload()
decoratorThe second option is a new decorator on an application command object that registers the overload. This alternative would fix the issue of marking the primary callback because the primary callback would be the original one:
The downside to this depends on implementation details. If the application command object has to be re-created because the overload functionality is in another class then it would be poor code-architecture to have the application command object do this itself.
Tasks
The text was updated successfully, but these errors were encountered: