How to resolve deprecation of Discord\Parts\Interactions\Interaction ?
#1442
-
|
I understand that I have a generic solution to implement a custom interface InteractionHandlerInterface
{
/**
* @return PromiseInterface<mixed>
*/
public function handle(Interaction $interaction): PromiseInterface;
}Now for me it does not matter which subobject it will call, as the each handler will reject if it does not support that interaction. So to resolve deprecation I'd need to everywhere write |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
I don't believe it has been decided yet as to whether or not the interaction class will be made fully abstract. The deprecation notice is so that users can be prepared and update to use non-generic classes where relevant. Things like listening for the interaction class on an interaction create event is still completely valid, and the deprecation can be disregarded. |
Beta Was this translation helpful? Give feedback.
-
|
Why would you type anything with |
Beta Was this translation helpful? Give feedback.


Interaction objects are no longer created internally. The non-abstract class still exists as a fallback for the instance where Discord might implement a new Interaction type that exceeds the currently existing classes. The base class also does not contain documented definitions for properties specific to those types, and contains documented definitions for those that cannot exist in specific contexts. You should use the specific interaction type relevant to your use-case rather than assuming this change has no constructive purpose.
To clarify, the use of Interaction is deprecated for userland, but may be used internally as a fallback in this specific edge case that currently does not exis…