From 378f67218cf5f9f359c2d75b2aeaa278f1b98243 Mon Sep 17 00:00:00 2001 From: MasedMSD Date: Wed, 16 Oct 2024 14:53:45 +0500 Subject: [PATCH] Fixed instruction in guide/introduction.md --- site/docs/guide/getting-started.md | 11 +++++------ site/docs/guide/introduction.md | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/site/docs/guide/getting-started.md b/site/docs/guide/getting-started.md index 1e4d01709..e2bd622e0 100644 --- a/site/docs/guide/getting-started.md +++ b/site/docs/guide/getting-started.md @@ -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 @@ -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. @@ -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] @@ -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. ::: diff --git a/site/docs/guide/introduction.md b/site/docs/guide/introduction.md index f76bf0ef6..a3136f1b0 100644 --- a/site/docs/guide/introduction.md +++ b/site/docs/guide/introduction.md @@ -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: