import IMessage from '../IMessage' ; import IMessageHandler from './IMessageHandler' ; import HandleResult from './HandleResult' ; import Command from '../../Command/Command' ; import ICommandHandler from '../../Command/Handler/ICommandHandler' ; class CommandMessageHandler implements IMessageHandler { constructor ( private handler ) { } public async Handle ( message ) { const command = new Command ( message . message . trim ( ) , message ) ; return this . handler . Handle ( command ) ; } } export default CommandMessageHandler ;