chore: Use get app helper to get application data
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import SlackClient from '../client';
|
||||
|
||||
export default class FindMessage {
|
||||
client: SlackClient;
|
||||
|
||||
constructor(client: SlackClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async run() {
|
||||
const parameters = this.client.step.parameters;
|
||||
const query = parameters.query as string;
|
||||
const sortBy = parameters.sortBy as string;
|
||||
const sortDirection = parameters.sortDirection as string;
|
||||
const count = 1;
|
||||
|
||||
const messages = await this.client.findMessages.run(
|
||||
query,
|
||||
sortBy,
|
||||
sortDirection,
|
||||
count,
|
||||
);
|
||||
|
||||
return messages;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import SlackClient from '../client';
|
||||
|
||||
export default class SendMessageToChannel {
|
||||
client: SlackClient;
|
||||
|
||||
constructor(client: SlackClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async run() {
|
||||
const channelId = this.client.step.parameters.channel as string;
|
||||
const text = this.client.step.parameters.message as string;
|
||||
|
||||
const message = await this.client.postMessageToChannel.run(channelId, text);
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user