mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-12-17 02:39:52 +03:00
feat(decorators): TelegrafSettings added
This commit is contained in:
@@ -60,6 +60,8 @@ export class TelegrafExplorer implements OnModuleInit {
|
||||
this.handleTelegrafStart(instance, key, telegraf);
|
||||
} else if (this.metadataAccessor.isTelegrafHelp(instance[key])) {
|
||||
this.handleTelegrafHelp(instance, key, telegraf);
|
||||
} else if (this.metadataAccessor.isTelegrafSettings(instance[key])) {
|
||||
this.handleTelegrafSettings(instance, key, telegraf);
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -116,4 +118,13 @@ export class TelegrafExplorer implements OnModuleInit {
|
||||
) {
|
||||
telegraf.help(instance[key].bind(instance));
|
||||
}
|
||||
|
||||
handleTelegrafSettings(
|
||||
instance: object,
|
||||
key: string,
|
||||
telegraf: Telegraf<ContextMessageUpdate>,
|
||||
) {
|
||||
// @ts-ignore
|
||||
telegraf.settings(instance[key].bind(instance));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user