feat(decorators): TelegrafGameQuery added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 17:28:56 +03:00
parent f65905ed0d
commit a2eb619e6b
5 changed files with 30 additions and 0 deletions

View File

@@ -99,6 +99,8 @@ export class TelegrafExplorer implements OnModuleInit {
instance[key],
);
this.handleTelegrafInlineQuery(instance, key, telegraf, metadata);
} else if (this.metadataAccessor.isTelegrafGameQuery(instance[key])) {
this.handleTelegrafGameQuery(instance, key, telegraf);
}
},
);
@@ -233,4 +235,12 @@ export class TelegrafExplorer implements OnModuleInit {
// @ts-ignore
telegraf.inlineQuery(metadata.triggers, instance[key].bind(instance));
}
handleTelegrafGameQuery(
instance: object,
key: string,
telegraf: Telegraf<ContextMessageUpdate>,
) {
telegraf.gameQuery(instance[key].bind(instance));
}
}