{"id":16526684,"url":"https://github.com/rtippin/messenger-faker","last_synced_at":"2025-03-21T09:31:10.064Z","repository":{"id":47134877,"uuid":"339475680","full_name":"RTippin/messenger-faker","owner":"RTippin","description":"Addon for rtippin/messenger that adds commands to mock/emit realtime events and messages to a given thread. Includes sending images, documents, audio files, message reactions and system messages. Great for use in a dev environment.","archived":false,"fork":false,"pushed_at":"2024-05-23T20:56:19.000Z","size":156,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T22:41:02.999Z","etag":null,"topics":["chat-application","command-line","discord","faker","faker-generator","helper","laravel","live-chat","messenger","realtime","seeder"],"latest_commit_sha":null,"homepage":"https://tippindev.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RTippin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"RTippin"}},"created_at":"2021-02-16T17:25:43.000Z","updated_at":"2024-05-23T20:52:37.000Z","dependencies_parsed_at":"2022-09-04T00:31:00.416Z","dependency_job_id":null,"html_url":"https://github.com/RTippin/messenger-faker","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTippin%2Fmessenger-faker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTippin%2Fmessenger-faker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTippin%2Fmessenger-faker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTippin%2Fmessenger-faker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RTippin","download_url":"https://codeload.github.com/RTippin/messenger-faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221813501,"owners_count":16884836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-application","command-line","discord","faker","faker-generator","helper","laravel","live-chat","messenger","realtime","seeder"],"created_at":"2024-10-11T17:29:31.372Z","updated_at":"2024-10-28T09:43:37.839Z","avatar_url":"https://github.com/RTippin.png","language":"PHP","funding_links":["https://github.com/sponsors/RTippin"],"categories":[],"sub_categories":[],"readme":"# Messenger Faker Commands\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Tests][ico-test]][link-test]\n[![StyleCI][ico-styleci]][link-styleci]\n[![License][ico-license]][link-license]\n\n---\n\n![Preview](https://i.imgur.com/NTjc1Pm.png)\n\n## This package is an addon for [rtippin/messenger][link-messenger]\n\n### It is NOT advised to install this in a production app.\n\n### Features:\n- Commands to mock realtime events such as knocks, typing, and marking read.\n- Command to seed realtime messages with typing.\n- Commands to seed attachment messages (images, documents, audio, videos).\n- Commands to seed system messages and message reactions.\n- `FakerBot` pre-registered with `Messenger` that allows you to trigger our commands through chat-bots.\n\n---\n\n# Installation\n\n### Via Composer\n\n``` bash\n$ composer require rtippin/messenger-faker --dev\n```\n\n---\n\n# Config\n\n- Default values for local storage location of the files we use when seeding.\n  - When seeding using local files, a random file from the message types specified folder will be used.\n  - When seeding image files with no url/local flag specified, it will use the default image url from the config.\n- Flag to enable or disable registering our `FakerBot`.\n\n***Defaults***\n```php\n'paths' =\u003e [\n    'images' =\u003e storage_path('faker/images'),\n    'documents' =\u003e storage_path('faker/documents'),\n    'audio' =\u003e storage_path('faker/audio'),\n    'videos' =\u003e storage_path('faker/videos'),\n],\n\n'default_image_url' =\u003e 'https://source.unsplash.com/random',\n\n'enable_bot' =\u003e true,\n```\n\n### To override the file paths, please publish our config and edit accordingly\n\n``` bash\n$ php artisan vendor:publish --tag=messenger-faker\n```\n\n___\n\n# Commands\n\n---\n\n### `php artisan messenger:faker:knock {thread?}`\n- Send a knock to the given thread.\n\n---\n\n### `php artisan messenger:faker:message {thread?}` | `--count=5` | `--delay=2` | `--admins` | `--silent`\n- Make participants send messages. Will also emit typing and mark read.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many messages are sent.\n- `--delay=X` flag to set delay in seconds between each message.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:react {thread?}` | `--count=5` | `--messages=5` | `--delay=1` | `--admins` | `--silent`\n- Make participants add reactions to the latest messages.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many reactions are added.\n- `--messages=X` flag to set how many latest messages are chosen at random to be reacted to.\n- `--delay=X` flag to set delay in seconds between each reaction.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:system {thread?}` | `--type=` | `--count=1` | `--delay=2` | `--admins` | `--silent`\n- Make participants send system messages.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many system messages are sent.\n- `--type=X` flag to set the system message type. `88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103`\n- `--delay=X` flag to set delay in seconds between each system message.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:image {thread?}` | `--count=1` | `--delay=2` | `--admins` | `--local` | `--url=` | `--silent`\n- Make participants send image messages. Will also emit typing and mark read. If `--local` or `--url` is not set, we pull images from the default image url in the config.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many images are sent.\n- `--delay=X` flag to set delay in seconds between each image.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--local` flag will choose a random image from the directory specified for images in the config file.\n- `--url=X` flag lets you directly specify an image URL to download and emit.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:document {thread?}` | `--count=1` | `--delay=2` | `--admins` | `--url=` | `--silent`\n- Make participants send document messages. Will also emit typing and mark read. If `--url` is not set, will choose a random document from the directory specified for documents in the config file.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many documents are sent.\n- `--delay=X` flag to set delay in seconds between each document.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--url=X` flag lets you directly specify a document URL to download and emit.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:audio {thread?}` | `--count=1` | `--delay=2` | `--admins` | `--url=` | `--silent`\n- Make participants send audio messages. Will also emit typing and mark read. If `--url` is not set, will choose a random audio file from the directory specified for audio in the config file.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many audio files are sent.\n- `--delay=X` flag to set delay in seconds between each audio file.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--url=X` flag lets you directly specify an audio URL to download and emit.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:video {thread?}` | `--count=1` | `--delay=2` | `--admins` | `--url=` | `--silent`\n- Make participants send video messages. Will also emit typing and mark read. If `--url` is not set, will choose a random video file from the directory specified for videos in the config file.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many video files are sent.\n- `--delay=X` flag to set delay in seconds between each video file.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--url=X` flag lets you directly specify a video URL to download and emit.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:random {thread?}` | `--count=5` | `--delay=2` | `--admins` | `--silent`\n- Send random commands using `['audio', 'document', 'image', 'knock', 'message', 'react', 'system', 'typing']`\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--count=X` flag to set how many messages are sent.\n- `--delay=X` flag to set delay in seconds between each message.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n- `--silent` flag that will suppress all broadcast and event dispatches.\n\n---\n\n### `php artisan messenger:faker:read {thread?}` | `--admins`\n- Mark participants in the thread as read.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--admins` flag will only use admin participants if using a group thread.\n\n---\n\n### `php artisan messenger:faker:typing {thread?}` | `--admins`\n- Make participants in the thread type.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--admins` flag will only use admin participants if using a group thread.\n- `--bots` flag will only use bots if using a group thread.\n\n---\n\n### `php artisan messenger:faker:unread {thread?}` | `--admins`\n- Mark participants in the thread as unread.\n- `{thread?}` ID of the thread you want to seed. Random if not set.\n- `--admins` flag will only use admin participants if using a group thread.\n\n---\n\n# FakerBot\n\n---\n\n- Our service provider will have already registered `FakerBot` for you if enabled in our config.\n- You should ensure your main `messenger.php` config has the bots feature enabled.\n- When you use the messenger API to add handlers onto a bot, you will see our bot listed.\n- Once our `FakerBot` is attached to a thread's bot, you can trigger it by sending a message using the following syntax:\n  - `!faker {action} {count?} {delay?}`\n- Available actions: `audio`, `document`, `image`, `knock`, `message`, `random`, `react`, `system`, `typing`, `video`\n\n\n[ico-version]: https://img.shields.io/packagist/v/rtippin/messenger-faker.svg?style=plastic\u0026cacheSeconds=3600\n[ico-downloads]: https://img.shields.io/packagist/dt/rtippin/messenger-faker.svg?style=plastic\u0026cacheSeconds=3600\n[link-test]: https://github.com/RTippin/messenger-faker/actions\n[ico-test]: https://img.shields.io/github/actions/workflow/status/rtippin/messenger-faker/test.yml?branch=master\u0026style=plastic\n[ico-styleci]: https://styleci.io/repos/339475680/shield?style=plastic\u0026cacheSeconds=3600\n[ico-license]: https://img.shields.io/github/license/RTippin/messenger-faker?style=plastic\n[link-packagist]: https://packagist.org/packages/rtippin/messenger-faker\n[link-downloads]: https://packagist.org/packages/rtippin/messenger-faker\n[link-license]: https://packagist.org/packages/rtippin/messenger-faker\n[link-styleci]: https://styleci.io/repos/339475680\n[link-messenger]: https://github.com/RTippin/messenger","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtippin%2Fmessenger-faker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtippin%2Fmessenger-faker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtippin%2Fmessenger-faker/lists"}