slackbolt应用程序签名秘密

ukqbszuj  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(273)

我一直在努力学习本教程:
https://api.slack.com/start/building/bolt-java
到目前为止,我已经创建了两个环境变量 SLACK_BOT_TOKEN 以及 SLACK_SIGNING_SECRET
现在在用maven运行java示例时

import com.slack.api.bolt.App;
import com.slack.api.bolt.AppConfig;
import com.slack.api.bolt.jetty.SlackAppServer;

public class MyApp {
    public static void main(String[] args) throws Exception {

        App app = new App();

        // All the room in the world for your code

        SlackAppServer server = new SlackAppServer(app);
        server.start();
    }
}

我得到以下例外:

Exception in thread "main" java.lang.IllegalArgumentException: The signing secret is required to generate signature values. Set the env variable SLACK_SIGNING_SECRET or pass the value to the single arg constructor.

我错过了什么?
这是我的 pom.xml :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>MyApp</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.slack.api</groupId>
            <artifactId>bolt-jetty</artifactId>
            <version>[1,)</version>
        </dependency>
    </dependencies>
</project>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题