feat: Convert all app files to JS
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import postMessage from './post-message';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
import postMessage from './post-message.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Send a direct message',
|
||||
key: 'sendDirectMessage',
|
||||
description: 'Sends a direct message to a user or yourself from the Slackbot.',
|
||||
description:
|
||||
'Sends a direct message to a user or yourself from the Slackbot.',
|
||||
arguments: [
|
||||
{
|
||||
label: 'To username',
|
||||
key: 'toUsername',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: 'Pick a user to send the message to.',
|
||||
variables: true,
|
||||
@@ -27,7 +28,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Message text',
|
||||
key: 'message',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'The content of your new message.',
|
||||
variables: true,
|
||||
@@ -35,7 +36,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Send as a bot?',
|
||||
key: 'sendAsBot',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
value: false,
|
||||
description:
|
||||
@@ -1,23 +1,14 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
import { URL } from 'url';
|
||||
|
||||
type TData = {
|
||||
channel: string;
|
||||
text: string;
|
||||
username?: string;
|
||||
icon_url?: string;
|
||||
icon_emoji?: string;
|
||||
};
|
||||
|
||||
const postMessage = async ($: IGlobalVariable) => {
|
||||
const postMessage = async ($) => {
|
||||
const { parameters } = $.step;
|
||||
const toUsername = parameters.toUsername as string;
|
||||
const text = parameters.message as string;
|
||||
const sendAsBot = parameters.sendAsBot as boolean;
|
||||
const botName = parameters.botName as string;
|
||||
const botIcon = parameters.botIcon as string;
|
||||
const toUsername = parameters.toUsername;
|
||||
const text = parameters.message;
|
||||
const sendAsBot = parameters.sendAsBot;
|
||||
const botName = parameters.botName;
|
||||
const botIcon = parameters.botIcon;
|
||||
|
||||
const data: TData = {
|
||||
const data = {
|
||||
channel: toUsername,
|
||||
text,
|
||||
};
|
||||
Reference in New Issue
Block a user