Giter VIP home page Giter VIP logo

deno-code-snippets's Introduction

Deno Code Snippets

This app demonstrates most of Slack's next-generation platform features in a simple form. Refer to each sub app's README for more details.

Guide Outline:


Setup

Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one set up, go ahead and create one. Also, please note that the workspace requires any of the Slack paid plans.

Install the Slack CLI

To use this template, you first need to install and configure the Slack CLI. Step-by-step instructions can be found in our Quickstart Guide.

Clone the Sample App

Start by cloning this repository:

# Clone this project onto your machine
$ slack create my-code-snippets-app -t slack-samples/deno-code-snippets

# Change into this project directory
$ cd my-code-snippets-app

Sample Apps

This app consists of a number of sample apps. Go over the list of sub-apps below and start with any of them:

The following ones may be a little bit advanced:

Resources

To learn more about developing with the CLI, you can visit the following guides:

To view all documentation and guides available, visit the Overview page.

deno-code-snippets's People

Contributors

cchensh avatar filmaj avatar github-actions[bot] avatar hello-ashleyintech avatar misscoded avatar mwbrooks avatar rafaelamsili avatar seratch avatar srajiang avatar vegeris avatar web-flow avatar williambergamin avatar zimeg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

codal-zelal

deno-code-snippets's Issues

Only one step can be run

Hello,
I'm trying to use the example, but it runs only the first step of workflow.
In the logs I see:

Connected, awaiting events
2023-01-27 08:35:47 [info] [Fn04LL34CX4M] (Trace=Tr04LQDC6WF7) Function execution started for workflow function 'OpenForm Demo Workflow'
2023-01-27 08:35:48 [info] [Wf04M1L7SRLH] (Trace=Tr04LCR9M4Q7) Executing workflow step 1 of 2
2023-01-27 08:35:48 [info] [Fn010N] (Trace=Tr04LCR9M4Q7) Function execution started for builtin function 'Open a form'
2023-01-27 08:35:55 [info] [Fn010N] (Trace=Tr04LCR9M4Q7) Function execution completed for function 'Open a form'
2023-01-27 08:35:56 [info] [Wf04M1L7SRLH] (Trace=Tr04LCR9M4Q7) Execution completed for workflow step 'Open a form'
2023-01-27 08:35:59 [info] [Fn04LL34CX4M] (Trace=Tr04LCRA4X7Z) Function execution started for workflow function 'OpenForm Demo Workflow'
2023-01-27 08:36:00 [info] [Wf04M1L7SRLH] (Trace=Tr04LQDCLXBP) Executing workflow step 1 of 2
2023-01-27 08:36:00 [info] [Fn010N] (Trace=Tr04LQDCLXBP) Function execution started for builtin function 'Open a form'
2023-01-27 08:36:14 [info] [Fn010N] (Trace=Tr04LQDCLXBP) Function execution completed for function 'Open a form'
2023-01-27 08:36:14 [info] [Wf04M1L7SRLH] (Trace=Tr04LQDCLXBP) Execution completed for workflow step 'Open a form'
^C

I tryied to write my own workflow. It works the same - only first step can be executed. The rest steps were not running.
The code of workflow:

export const workflow = DefineWorkflow({
  callback_id: "test_feedback",
  title: "Feedback",
  description: "test the feedback",
  input_parameters: {
    properties: {
      interactivity: {
        type: Schema.slack.types.interactivity,
      },
    },
    required: ["interactivity"],
  },
});

workflow.addStep(Schema.slack.functions.SendMessage, {
  channel_id: "id",
  message: `**1 You feedback is accepted!**`
})

workflow.addStep(Schema.slack.functions.SendMessage, {
  channel_id: "id",
  message: `**2 You feedback is accepted!**`
})

export default Manifest({
  name: "app-name-123",
  description: "description",
  icon: "assets/default_new_app_icon.png",
  workflows: [workflow],
  outgoingDomains: [],
  botScopes: ["commands", "chat:write", "chat:write.public", "app_mentions:read"],
});

Trigger:

import { Trigger } from "deno-slack-api/types.ts";
import { workflow } from "./manifest.ts";

const trigger: Trigger<typeof workflow.definition> = {
  type: "shortcut",
  name: "Submit a feedback",
  description: "feedback",
  workflow: `#/workflows/${workflow.definition.callback_id}`,
  inputs: {
    interactivity: { value: "{{data.interactivity}}" },
    user_id: { value: "{{data.user_id}}" },
    channel_id: { value: "{{data.channel_id}}" },
  },
};

export default trigger;

In dev mode I see:

Connected, awaiting events
2023-01-27 08:33:53 [info] [Fn04MCJ0MQF2] (Trace=Tr04M60WUK33) Function execution started for workflow function 'Passenger Feedback'
2023-01-27 08:33:54 [info] [Wf04LNPMS2DR] (Trace=Tr04LVRA726Q) Executing workflow step 1 of 2
2023-01-27 08:33:54 [info] [Fn0102] (Trace=Tr04LVRA726Q) Function execution started for builtin function 'Send a message'
2023-01-27 08:33:55 [info] [Fn0102] (Trace=Tr04LVRA726Q) Function execution completed for function 'Send a message'
2023-01-27 08:33:55 [info] [Wf04LNPMS2DR] (Trace=Tr04LVRA726Q) Execution completed for workflow step 'Send a message'
^C

How to run all the steps from workflow?

Some data cannot be obtained when event_type is app_mentioned

Hello.
I am currently using app_mentioned, but there is something I am not sure about.

const trigger: Trigger<typeof MyWorkflow.definition> = {
  ...
  event: {
    event_type: "slack#/events/app_mentioned",
...

The following documentation appears to include message_ts in the app_mentioned event, but I can't actually get them.
https://api.slack.com/automation/triggers/event

{
  "team_id": "T0123ABC",
  "enterprise_id": "E0123ABC",
  "event_id": "Ev0123ABC",
  "event_timestamp": 1643810217.088700,
  "type": "event",
  "data": {
    "app_id": "A1234ABC",
    "channel_id": "C0123ABC",
    "channel_name": "cool-channel",
    "channel_type": "public/private/im/mpim",
    "event_type": "slack#/events/app_mentioned",
    "message_ts": "164432432542.2353",
    "text": "<@U0LAN0Z89> is it everything a river should be?",
    "user_id:": "U0123ABC",
  }
}

The input definition on my workflow side exists, but when I actually debug it, it is empty.
Is this a known issue?

I can provide a sample repository and PR if needed.
Thanks πŸ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.