BREAKING CHANGE(changed main class to SlackAccount): update

This commit is contained in:
Philipp Kunz 2019-09-18 15:11:55 +02:00
parent ec17d7835e
commit 3510767a72
3 changed files with 6 additions and 6 deletions

View File

@ -5,11 +5,11 @@ let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit');
import * as slackme from '../ts/index';
let testSlackme: slackme.Slackme;
let testSlackme: slackme.SlackAccount;
let testSlackMessage: slackme.SlackMessage;
tap.test('should create a valid slackme instance', async (tools) => {
testSlackme = new slackme.Slackme(testQenv.getEnvVarOnDemand('SLACK_TOKEN'));
testSlackme = new slackme.SlackAccount(testQenv.getEnvVarOnDemand('SLACK_TOKEN'));
});
tap.test('should send a message to Slack', async (tools) => {

View File

@ -1,7 +1,7 @@
import * as plugins from './slack.plugins';
import { IMessageOptions } from './slack.classes.slackmessage';
export class Slackme {
export class SlackAccount {
private postUrl = 'https://slack.com/api/chat.postMessage';
private updateUrl = 'https://slack.com/api/chat.update';
private slackToken: string;

View File

@ -1,5 +1,5 @@
import * as plugins from './slack.plugins';
import { Slackme } from './slack.classes.slackme';
import { SlackAccount } from './slack.classes.slackme';
export interface IAttachmentField {
title: string;
@ -53,11 +53,11 @@ export interface IMessageOptions {
}
export class SlackMessage {
slackmeRef: Slackme;
slackmeRef: SlackAccount;
messageOptions: IMessageOptions;
channel: string;
ts: string;
constructor(messageOptionsArg: IMessageOptions, slackmeArg?: Slackme) {
constructor(messageOptionsArg: IMessageOptions, slackmeArg?: SlackAccount) {
if (slackmeArg) {
this.slackmeRef = slackmeArg;
}