Skip to content

Windows Setup

AstroX10 edited this page Dec 28, 2024 · 2 revisions

WINDOWS SUPPORT GUIDE

1. Install Node.js

Why?
Node.js is required to run JavaScript code and manage the dependencies of the bot.

  • Download Node.js
  • Run the installer and follow the on-screen instructions.
  • To confirm installation, open a terminal (Command Prompt or PowerShell) and run:
    node -v
    You should see the version number printed.

2. Install Git

Why?
Git is necessary to clone the repository and manage version control.

  • Download Git

  • Install Git using the downloaded executable. During installation:

    • Choose "Use Git from the command line and also from 3rd-party software."
    • Select other preferences as needed.
  • Verify the installation by running:

    git --version

3. Install Yarn Globally

Why?
Yarn is a fast and efficient package manager used to install the project dependencies.

  • Open the terminal and run:
    npm i -g yarn

4. Clone the Repository

Why?
You need the bot's source code to set it up.

  • Clone the repository:
    git clone https://github.com/AstroX11/Xstro.git
  • Navigate to the cloned directory:
    cd Xstro

5. Install Project Dependencies

Why?
Dependencies are the libraries and tools required to run the bot.

  • Run the following command inside the Xstro directory:
    yarn install

6. Create a .env File

Why?
The .env file is used to configure environment variables for the bot. This allows for customization and secure storage of sensitive data.

  • In the Xstro directory, create a file named .env.
  • Add the following content:
    SESSION_ID=''
    BOT_INFO=Astro;Xstro-Md;
    STICKER_PACK=Astro;Xstro
    
    Replace SESSION_ID with the session key you generate during authentication.

7. Start the Bot

Why?
This launches the bot and makes it operational.

  • Run the following command to start the bot:
    npm start

If everything is set up correctly, the bot should now be running.


Common Issues and Solutions

  • Missing Dependencies:
    If you encounter errors during yarn install, try running:

    yarn cache clean
    yarn install
  • Configuration Errors:
    Double-check your .env file to ensure all variables are correctly filled. If you don't know it just edit directly from config.js which I strongly don't recommend.

  • Session Issues:
    Ensure the SESSION_ID value is generated properly by following the bot's authentication process. If your Session refuses to connect get a new one or scan directly from the Qr terminal

  • Port Conflicts:
    If the bot fails to start due to port issues, ensure no other application is using the default port.