| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { WebClient, LogLevel } from '@slack/web-api';
- import { parse } from '../utils/slash-command-parser';
- export const openModal = async(body) => {
- const client = new WebClient('xoxb-1399660543842-1848670292404-huKeykaKhdyLyBqTiVlMxqY8', { logLevel: LogLevel.DEBUG });
- await client.views.open({
- trigger_id: body.trigger_id,
- view: {
- type: 'modal',
- title: {
- type: 'plain_text',
- text: 'My App',
- },
- close: {
- type: 'plain_text',
- text: 'Close',
- },
- blocks: [
- {
- type: 'section',
- text: {
- type: 'mrkdwn',
- text: 'About',
- },
- },
- {
- type: 'context',
- elements: [
- {
- type: 'mrkdwn',
- text: 'Psssst',
- },
- ],
- },
- ],
- },
- });
- console.log('openModal');
- };
|