Skip to content

Commit

Permalink
Fixed instruction in guide/introduction.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MasedMSD committed Oct 16, 2024
1 parent fe5473b commit 378f672
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
11 changes: 5 additions & 6 deletions site/docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,14 @@ mkdir my-bot
cd my-bot
```

Next step we should initialise our project.
Next step you should initialise your project.

```sh
# Run bun init to scaffold a new project.
bun init

```

After running the command, the script will prompt us to select our project name and entry point.
After running the command, the script will prompt you to select project name and entry point.

```ansi{3-4,12}
bun init helps you get started with a minimal project and tries to guess sensible defaults. Press ^C anytime to quit
Expand All @@ -190,7 +189,7 @@ To get started, run: // [!code focus]
bun run bot.ts // [!code focus]
```

And finally we can add `grammy` package.
And finally you can add `grammy` package.

```sh
# Install grammY.
Expand All @@ -215,7 +214,7 @@ Talk to [@BotFather](https://t.me/BotFather) to do this.
The bot token looks like `123456:aBcDeF_gHiJkLmNoP-q`.
It is used to authenticate your bot.

Got the token? You can now code your bot in the `index.ts` file.
Got the token? You can now code your bot in the `bot.ts` file.
You can copy the following example bot into that file, and pass your token to the `Bot` constructor:

```ts [TypeScript]
Expand Down Expand Up @@ -257,7 +256,7 @@ You can enable basic logging by running
export DEBUG="grammy*"
```

in your terminal before you execute `bun run index.ts`.
in your terminal before you execute `bun run bot.ts`.
This makes it easier to debug your bot.
:::

Expand Down
17 changes: 14 additions & 3 deletions site/docs/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,20 @@ code .

Then:

1. Run `bun init --yes` in your terminal to initialize the project.
2. Create a source file `bot.ts` with TypeScript code inside the project.
3. Run `bun run bot.ts` from your terminal, or run `bun --watch run bot.ts` if you want to keep updated with file changes.
1. Run `bun init` in your terminal to initialize the project and fill it out as written below.
```ansi{3-4,12}
bun init helps you get started with a minimal project and tries to guess sensible defaults. Press ^C anytime to quit
package name (my-bot): my-bot // [!code focus]
entry point (index.ts): bot.ts // [!code focus]
Done! A package.json file was saved in the current directory.
+ bot.ts
+ .gitignore
+ tsconfig.json (for editor auto-complete)
+ README.md
```
2. Run `bun run bot.ts` from your terminal, or run `bun --watch run bot.ts` if you want to keep updated with file changes.

Ready?
[Get started](./getting-started#getting-started-on-bun)! :robot:
Expand Down

0 comments on commit 378f672

Please sign in to comment.