Selfhost
Table of contents
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
- Open an empty folder
- 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!") - Press
ctrl + shift + P, and then selectPython: Create Environment... - Select
Venv, the download will start and might take a short while
Terminal
- Press
ctrl + shift + Pagain and now selectPython: Create Terminal - Run the command
.venv\Scripts\Activatein the terminal, a green (.venv) tag will appear - Go ahead and run
pip install ChatSelfbot, this will install the newest verion of our library - Now run
py bot.pyin the terminal (replace bot if you used a different name) - 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!