clairton / unoapi-cloud

Unofficial Whatsapp Cloud Api - Same format as whastapp cloud api, but without spent
GNU General Public License v3.0
165 stars 54 forks source link

Fix Log for WAWeb version and default version #78

Closed PP-Contrib closed 2 months ago

PP-Contrib commented 2 months ago

Fix Log for WAWeb version and Change and Default WAWeb version to default baileys version

Summary by CodeRabbit

coderabbitai[bot] commented 2 months ago

Walkthrough

The changes involve updates to the WHATSAPP_VERSION constant in the src/defaults.ts file, allowing it to default to a version specified in the DEFAULT_CONNECTION_CONFIG from the @whiskeysockets/baileys package if the environment variable is not set. Additionally, the log message in the connect function of src/services/socket.ts has been modified to clarify the distinction between the WhatsApp version of the connected device and the latest version of the Baileys library.

Changes

Files Change Summary
src/defaults.ts Updated WHATSAPP_VERSION to use DEFAULT_CONNECTION_CONFIG.version for default value instead of hardcoded array.
src/services/socket.ts Modified log message in connect function to specify connection using predefined WHATSAPP_VERSION and latest Baileys version.

Poem

🐇 In the code where changes flow,
A version's tale begins to grow.
With logs that shine and constants bright,
Our rabbit hops with pure delight!
Configurable paths, a clearer way,
Let’s celebrate this brand new day! 🌟


Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between c22f8e01654501ce5a0b8b957ce094ba281a4807 and 736016fb014c64001c5ce687a5fe61867b76ce5c.
Files selected for processing (2) * src/defaults.ts (2 hunks) * src/services/socket.ts (1 hunks)
Additional comments not posted (2)
src/defaults.ts (1)
`111-111`: **LGTM!** The change to default `WHATSAPP_VERSION` to the version specified in `DEFAULT_CONNECTION_CONFIG` is a good improvement. It enhances configurability, maintainability, and adaptability of the code by removing the hardcoded default value and aligning the default WAWeb version with the default baileys version, as intended in the PR objectives. The change looks safe and I don't see any issues or potential side effects.
src/services/socket.ts (1)
`159-159`: **LGTM!** The updated log message provides clearer information by distinguishing between the WhatsApp version used for the connection and the latest Baileys version. This change enhances the logging for debugging and monitoring purposes, aligning with the PR objective of improving the accuracy of the logs concerning the WAWeb version.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.