@racla-dev/node-iris
Version:
TypeScript port of Python irispy-client module for KakaoTalk bot development
37 lines • 1.32 kB
JavaScript
;
/**
* Base Controller class for bot command handling
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseController = void 0;
class BaseController {
constructor(kakaoLink) {
this.kakaoLink = kakaoLink;
}
/**
* Get all methods with decorators from this controller
*/
getDecoratedMethods() {
const methods = [];
const prototype = Object.getPrototypeOf(this);
const methodNames = Object.getOwnPropertyNames(prototype);
for (const methodName of methodNames) {
if (methodName === 'constructor' || methodName === 'getDecoratedMethods')
continue;
const method = this[methodName];
if (typeof method === 'function') {
// Check if method has BotCommand metadata
const boundMethod = method.bind(this);
// For now, we'll scan all methods and let the Bot class handle the filtering
// In the future, we could check for actual decorator metadata here
methods.push({
methodName,
method: boundMethod,
});
}
}
return methods;
}
}
exports.BaseController = BaseController;
//# sourceMappingURL=BaseController.js.map