import * as needle from 'needle' ; interface SlackMessage { text : string ; channel ? : string ; } export class SlackWebhook { constructor ( private url , private channel ? ) { } public async send ( text ) { const msg = { text , channel : this . channel } ; return needle ( 'post' , this . url , msg , { json : true } ) ; } }