fix(core): update
This commit is contained in:
@ -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]
|
||||
|
@ -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!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
// pushrocks scope
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
|
||||
export { smartrequest };
|
||||
|
Reference in New Issue
Block a user