Selfhost

Table of contents

  1. Selfhost
    1. Video tutorial
    2. Step 1. Install required libraries
      1. Virtual environment
      2. Terminal
    3. Step 2. Your first code!

We expect that you are using Visual Studio Code to selfhost, with all python extensions installed

Video tutorial

Step 1. Install required libraries

Virtual environment

  1. Open an empty folder
  2. Add a file named bot.py (or anything like that, as long as it’s python), and set the source to:
    from ChatSelfbot import BotService
    print("Hello world!")
    
  3. Press ctrl + shift + P, and then select Python: Create Environment...
  4. Select Venv, the download will start and might take a short while

Terminal

  1. Press ctrl + shift + P again and now select Python: Create Terminal
  2. Run the command .venv\Scripts\Activate in the terminal, a green (.venv) tag will appear
  3. Go ahead and run pip install ChatSelfbot, this will install the newest verion of our library
  4. Now run py bot.py in the terminal (replace bot if you used a different name)
  5. Did it print hello world without errors? Great! Now continue step 2
    (If there are errors, contact me!)

Step 2. Your first code!

This example code is from V1.1.0, it may be outdated
Go to bot.py, and set the code to this (make sure to replace “username” with your username and “password” with your password!):

from ChatSelfbot import BotService
bot = BotService.create_bot()
if bot.login("username", "password"):
    messages = bot.MessageService
    messages.create_post("Hello! I am a selfbot :D")

Run the command py bot.py again in your terminal and go to Chat, did a new message by you appear? In that case you succesfully connected selfbot, read through the rest of the documentation to create the best selfbot of them all!

Remember: your ChatSelfbot won’t automatically update! Keep track of announcements in Chat and download the newest update by running pip install --upgrade ChatSelfbot in your terminal!