Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the docs to use WechatyBuilder to instantiate the Wechaty instance #1532

Merged
merged 10 commits into from
Mar 15, 2024

Conversation

leotaozeng
Copy link
Member

@leotaozeng leotaozeng commented Mar 13, 2024

Summary by CodeRabbit

  • Documentation
    • Updated the Getting Started guide to reflect the renaming of Wechaty class to WechatyBuilder for bot instance initialization.

Copy link
Contributor

coderabbitai bot commented Mar 13, 2024

Walkthrough

The change introduces a significant transformation in managing bot instances by transitioning from the Wechaty class to the WechatyBuilder class for bot initialization. This alteration enhances the structure and coherence of the bot setup process, streamlining bot creation within the framework.

Changes

File Path Change Summary
.../getting-started/running-locally.mdx Renamed Wechaty class to WechatyBuilder in imports and bot initialization

🐇✨
In the realm of code, where algorithms dance,
Wechaty becomes WechatyBuilder, a new chance.
With a leap and a bound, the shift takes flight,
Crafting bots with grace, in the digital light.
So perk up your ears, to the tech symphony so dear,
A fresh dawn of bot crafting is here!
🎉🐰

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

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests 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 tests 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 tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@CLAassistant
Copy link

CLAassistant commented Mar 13, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 87f96e9 and c4a0d55.
Files selected for processing (1)
  • docusaurus/docs/getting-started/running-locally.mdx (2 hunks)
Additional comments: 1
docusaurus/docs/getting-started/running-locally.mdx (1)
  • 290-296: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [286-293]

There are extra spaces in the import statements, which could be cleaned up for better readability. Additionally, consider organizing imports in a consistent order, such as external libraries followed by internal modules.

-import {
-  Contact,
-  Message,
-  ScanStatus,
-  WechatyBuilder,
-  log,
-}from 'wechaty'
+import { Contact, Message, ScanStatus, WechatyBuilder, log } from 'wechaty'

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c4a0d55 and f3d5826.
Files selected for processing (1)
  • docusaurus/docs/getting-started/running-locally.mdx (2 hunks)
Additional comments: 1
docusaurus/docs/getting-started/running-locally.mdx (1)
  • 293-293: The import statement correctly reflects the transition from Wechaty to WechatyBuilder, aligning with the PR's objective to update the documentation according to the latest practices of the Wechaty framework.

docusaurus/docs/getting-started/running-locally.mdx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f3d5826 and 5aeba44.
Files selected for processing (1)
  • docusaurus/docs/getting-started/running-locally.mdx (3 hunks)
Additional comments: 2
docusaurus/docs/getting-started/running-locally.mdx (2)
  • 293-293: The import statement for WechatyBuilder correctly aligns with the PR's objective to update the documentation for using WechatyBuilder instead of Wechaty. However, it's important to ensure that all references and examples in the documentation consistently use WechatyBuilder.
  • 364-367: The instantiation of WechatyBuilder and the bot's start process are correctly updated according to the PR's objectives. However, the error handling for the bot's start process is already mentioned in the comments from previous reviews, emphasizing its importance for gracefully managing potential startup errors.

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

please remove the unnecessary changes as I commented, and then this PR will be good to be merged!

docusaurus/docs/getting-started/running-locally.mdx Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5aeba44 and 0c9da69.
Files ignored due to path filters (1)
  • package.json is excluded by: !**/*.json
Files selected for processing (1)
  • docusaurus/docs/getting-started/running-locally.mdx (3 hunks)
Additional comments: 2
docusaurus/docs/getting-started/running-locally.mdx (2)
  • 293-293: The transition from Wechaty to WechatyBuilder for creating the Wechaty instance is correctly implemented in the import statement. This aligns with the PR's objective to modernize the documentation.
  • 364-371: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [367-386]

The instantiation of the WechatyBuilder is correct and aligns with the PR's objective. However, it's a good practice to add error handling for the bot's start process to gracefully handle potential startup errors.

bot.start()
  .then(() => log.info('StarterBot', 'Starter Bot Started.'))
+ .catch(e => log.error('StarterBot', 'Failed to start the bot:', e))

@leotaozeng leotaozeng requested a review from huan March 14, 2024 05:29
@leotaozeng
Copy link
Member Author

Thanks for the contribution!

please remove the unnecessary changes as I commented, and then this PR will be good to be merged!

I've removed the unnecessary changes. Please review it again! Thank you!

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huan huan enabled auto-merge (squash) March 14, 2024 06:09
@huan
Copy link
Member

huan commented Mar 14, 2024

Thank you very much for your contribution!

You are welcome to join Wechaty Contributor Program

1. Join Wechaty Organization

You've invited Leo Zeng to Wechaty! They'll be receiving an email shortly. They can also visit https://github.com/wechaty to accept the invitation.

I have invited you to join our Wechaty GitHub Organization; please accept it by following the above message. (See also: wechaty/PMC#16)

2. Update Your Wechaty Contributor Profile

  1. Please open Contributor Hall of Fame and add yourself to the end of the list, so that other contributors will know you better!
  2. Please add yourself to our Website Contributors by creating a PR and refer to this PR link as well.

3. Join the Wechaty Official Community on Discord

Make sure you have joined Discord! Join now if you are not: https://discord.gg/7q8NBZbQzt

4. Join The Contributor-Only WeChat Room

We also have a WeChat room for contributors who can discuss Wechaty at a deeper level; you are welcome to join if interested.

Please add @lijiarui wechat: ruirui_0914 and send her this PR link. She will invite you into the Wechaty Contributor Room.

Cheers!

@huan huan disabled auto-merge March 15, 2024 01:57
@huan huan merged commit c97fbc0 into wechaty:main Mar 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants