Coder Social home page Coder Social logo

seratch / deno-slack-source-file-resolver Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 18 KB

Automatically resolve functions' source_file for Slack's next-generation platform apps

Home Page: https://deno.land/x/deno_slack_source_file_resolver

License: MIT License

TypeScript 100.00%
deno slack slack-api slack-apis slack-bot slack-bots

deno-slack-source-file-resolver's Introduction

Important Notice: This module does not work for production apps deployed by slack deploy command, while it works for slack run app perfectly.

deno_slack_source_file_resolver

deno_slack_source_file_resolver is a tiny utility for Slack's next-generation platform. With this module, you don't need to manually synchronize the source_file path name when you rename/move the file.

How It Works

It's pretty simple to use this module! You can import the FunctionSourceFile module and using it inside DefineFunction initialization code:

import { DefineFunction, Schema, SlackFunction } from "deno-slack-sdk/mod.ts";
// ADD THIS
import { FunctionSourceFile } from "https://deno.land/x/[email protected]/mod.ts";

export const GreetingFunctionDefinition = DefineFunction({
  callback_id: "greeting_function",
  title: "Generate a greeting",
  // REPLACE THIS PART
  // source_file: "functions/greeting_function.ts",
  source_file: FunctionSourceFile(import.meta.url),
  input_parameters: { properties: {}, required: [] },
  output_parameters: { properties: {}, required: [] },
});

Please note that, when you use this module, deno test command needs to be deno test --allow-read instead. As for running your app by slack run and your deployed apps, no extra configuration is requied.

LICENSE

The MIT License

deno-slack-source-file-resolver's People

Contributors

seratch avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.