feat(slack): add find user by email action

This commit is contained in:
Ali BARIN
2023-01-30 23:37:58 +00:00
parent 1118d025bf
commit 01bb1259eb
3 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
import defineAction from '../../../../helpers/define-action';
export default defineAction({
name: 'Find user by email',
key: 'findUserByEmail',
description: 'Finds a user by email.',
arguments: [
{
label: 'Email',
key: 'email',
type: 'string' as const,
required: true,
variables: true,
},
],
async run($) {
const params = {
email: $.step.parameters.email as string,
};
const { data } = await $.http.get('/users.lookupByEmail', {
params
});
if (data.ok) {
$.setActionItem({ raw: data.user });
}
},
});

View File

@@ -1,4 +1,5 @@
import findMessage from './find-message';
import findUserByEmail from './find-user-by-email';
import sendMessageToChannel from './send-a-message-to-channel';
export default [findMessage, sendMessageToChannel];
export default [findMessage, findUserByEmail, sendMessageToChannel];

View File

@@ -3,6 +3,8 @@ favicon: /favicons/slack.svg
items:
- name: Find a message
desc: Finds a message using the Slack search feature.
- name: Find user by email
desc: Finds a user by email.
- name: Send a message to channel
desc: Sends a message to a channel you specify.
---