Skip to content

Conversation

@Lukasss93
Copy link
Member

@Lukasss93 Lukasss93 commented Apr 7, 2025

This PR adds a --watch option to the nutgram:run command, which allows you to run the bot in watch mode.
This means that the bot will automatically restart whenever you make changes to the code,
making it easier to develop and test your bot.

Usage

To use the --watch option, simply run the following command:

php artisan nutgram:run --watch

Requirements

In your project, you should have the JavaScript package chokidar installed. You can install it via npm

npm install chokidar

or Yarn

yarn add chokidar

Configuration

You can configure the watch command in your config/nutgram.php file.

// ...

// Watch options used by the "nutgram:run --watch" command
'watch' => [

    // The paths to watch for changes
    'paths' => [
        app_path('Telegram'),
    ],

    // The extensions to watch for changes
    'extensions' => [
        'php',
    ],
],

@Lukasss93 Lukasss93 added the enhancement New feature or request label Apr 7, 2025
@Lukasss93 Lukasss93 requested a review from sergix44 April 7, 2025 23:18
@Lukasss93 Lukasss93 self-assigned this Apr 7, 2025
@Lukasss93 Lukasss93 added the help wanted Extra attention is needed label Apr 7, 2025
@DanielSpravtsev
Copy link

@Lukasss93 @sergix44 This is my dream command 😃

@Lukasss93
Copy link
Member Author

Lukasss93 commented May 30, 2025

Currently only php files are supported. Would it be better to make it configurable which extensions you want to support?
Example: json format translation files used by the bot, images, etc...

@sergix44

@DanielSpravtsev
Copy link

Currently only php files are supported. Would it be better to make it configurable which extensions you want to support? Example: json format translation files used by the bot, images, etc... @sergix44

Maybe we could also move this to a config?
Something like:
$types = ['.php'];
That way it defaults to .php, but users can add other extensions if needed — like .json for bot translations, images, etc.

@sergix44 sergix44 mentioned this pull request Jun 12, 2025
@Lukasss93
Copy link
Member Author

I close in favor of #29

@Lukasss93 Lukasss93 closed this Jun 13, 2025
@Lukasss93 Lukasss93 deleted the run-watch branch November 29, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants