Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions docs/english/building-an-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Create and move into a new directory before you initialize the project:
$ mkdir first-bolt-app
$ cd first-bolt-app
$ npm init
$ npm pkg set type=module
```

You’ll be prompted with a series of questions to describe your new project (you can accept the defaults by hitting <kbd>Enter</kbd> on each prompt if you aren’t picky). After you’re done, you’ll have a new `package.json` file in your directory.
Expand Down Expand Up @@ -211,7 +212,7 @@ $ export SLACK_APP_TOKEN=xapp-<your-app-token>
Create a new entrypoint file called `app.js` in your project directory and add the following code:

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your Slack app and bot token
const app = new App({
Expand Down Expand Up @@ -248,7 +249,7 @@ $ export SLACK_SIGNING_SECRET=<your-signing-secret>
2. Create a new entrypoint file called `app.js` in your project directory and add the following code:

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your bot token and signing secret
const app = new App({
Expand Down Expand Up @@ -346,7 +347,7 @@ The following example listens and responds to all messages in channels/DMs where
<TabItem value="socket-mode" label="Socket Mode">

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your Slack app and bot token
const app = new App({
Expand Down Expand Up @@ -375,7 +376,7 @@ app.message("hello", async ({ message, say }) => {
<TabItem value="http" label="HTTP">

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your bot token and signing secret
const app = new App({
Expand Down Expand Up @@ -440,7 +441,7 @@ Below, the `app.js` file from the last section is modified to send a message con
<TabItem value="socket-mode" label="Socket Mode">

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your Slack app and bot token
const app = new App({
Expand Down Expand Up @@ -488,7 +489,7 @@ app.message("hello", async ({ message, say }) => {
<TabItem value="http" label="HTTP">

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your bot token and signing secret
const app = new App({
Expand Down Expand Up @@ -559,7 +560,7 @@ https://github.com/slack-samples/bolt-js-getting-started-app/blob/main/app.js
<TabItem value="http" label="HTTP">

```javascript title="app.js"
const { App } = require("@slack/bolt");
import { App } from "@slack/bolt";

// Initializes your app with your bot token and signing secret
const app = new App({
Expand Down
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁️‍🗨️ note: This page is moved to match the English translations above so the fallback Quickstart guide appears as expected!

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Slack アプリで使用できるトークンには、ユーザートークン
mkdir first-bolt-app
cd first-bolt-app
npm init
npm pkg set type=module
```

新しいプロジェクトを説明するための一連の質問が表示されます (特に問題がなければ、各プロンプトで <kbd>Enter</kbd> を押すと、デフォルトを受け入れることができます)。完了すると、ディレクトリ内に新しい `package.json` ファイルが作成されます。
Expand Down Expand Up @@ -99,7 +100,7 @@ npm install @slack/bolt
このディレクトリ内に `app.js` という名前の新しいファイルを作成し、以下のコードを追加します。

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

// ボットトークンと Signing Secret を使ってアプリを初期化します
const app = new App({
Expand Down Expand Up @@ -224,7 +225,7 @@ const app = new App({
<TabItem value="socket-mode" label="Socket Mode">

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down Expand Up @@ -254,7 +255,7 @@ app.message('hello', async ({ message, say }) => {
<TabItem value="http" label="HTTP">

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down Expand Up @@ -321,7 +322,7 @@ app.message('hello', async ({ message, say }) => {
<TabItem value="socket-mode" label="Socket Mode">

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down Expand Up @@ -370,7 +371,7 @@ app.message('hello', async ({ message, say }) => {
<TabItem value="http" label="HTTP">

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down Expand Up @@ -431,7 +432,7 @@ app.message('hello', async ({ message, say }) => {
<TabItem value="socket-mode" label="Socket Mode">

```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down Expand Up @@ -487,7 +488,7 @@ app.action('button_click', async ({ body, ack, say }) => {


```javascript
const { App } = require('@slack/bolt');
import { App } from "@slack/bolt";

const app = new App({
token: process.env.SLACK_BOT_TOKEN,
Expand Down