fix(context.ts) fixed bug on type constraints

This commit is contained in:
Jacob Nguyen
2022-03-29 01:00:35 -05:00
parent 145fcb37fe
commit 26c202294f

View File

@@ -19,11 +19,11 @@ export default class Context<I extends Interaction = Interaction> {
this.msg = message;
this.interac = interaction;
}
static wrap<I extends Interaction>(wrappable: I | Message) : Context<I> {
static wrap<I extends Interaction = Interaction>(wrappable: I | Message) : Context<I> {
if ( "token" in wrappable) {
return new Context( None, Some(wrappable));
return new Context<I>( None, Some(wrappable));
}
return new Context(Some(wrappable), None)
return new Context<I>(Some(wrappable), None)
}
private get messageUnchecked() {