fix(core): update

This commit is contained in:
2019-09-05 13:08:42 +02:00
parent 55e75766b7
commit eeb1a99884
12 changed files with 1102 additions and 343 deletions

View File

@ -8,8 +8,8 @@ export class Slackme {
this.postRoute = postRouteArg;
}
sendMessage(messageOptionsArg: IMessageOptions, channelArg: string = 'general') {
plugins.smartrequest.postJson(`${this.baseUrl}${this.postRoute}`, {
async sendMessage(messageOptionsArg: IMessageOptions, channelArg: string = 'general') {
await plugins.smartrequest.postJson(`${this.baseUrl}${this.postRoute}`, {
requestBody: {
channel: channelArg,
attachments: [messageOptionsArg]

View File

@ -64,9 +64,11 @@ export class SlackMessage {
}
this.messageOptions = messageOptionsArg;
}
sendToRoom(roomNameArg: string) {
async sendToRoom(roomNameArg: string) {
if (this.slackmeRef) {
this.slackmeRef.sendMessage(this.messageOptions, roomNameArg);
await this.slackmeRef.sendMessage(this.messageOptions, roomNameArg);
} else {
throw new Error('you need to set a slackRef before sending the message!');
}
}
}

View File

@ -1,3 +1,4 @@
// pushrocks scope
import * as smartrequest from '@pushrocks/smartrequest';
export { smartrequest };