BOT BUILDING 101: Build Your First Simple Bot (No Experience Needed)
🎯 What You’ll Build:
A basic chatbot that automatically replies to messages — runs on your own computer.
No prior coding knowledge needed.
🔧 TOOLS YOU’LL NEED:
-
A Windows or Mac computer
-
Internet access
-
Free software: Python + VS Code
🔹 PART 1: Install Python (The Brain of Your Bot)
🖥️ For Windows Users:
-
Open your web browser (Chrome, Edge, or Firefox).
-
Go to this website:
👉 https://www.python.org/downloads -
Click the yellow button that says Download Python 3.x.x (you’ll see the latest version like 3.12.3).
-
Wait for the download to finish (usually bottom-left of your browser).
-
Click the downloaded file once it's ready. It’s named like python-3.x.x.exe.
-
⚠️ IMPORTANT:
Before clicking anything, check the small checkbox that says
“Add Python to PATH” — this is critical! ✅
If you miss this, your bot won’t run. -
Now click the big button that says Install Now.
-
Wait 1–3 minutes. You’ll see Setup was successful.
-
Click Close.
✅ Done! You now have Python installed.
🔹 PART 2: Install VS Code (Where You'll Write the Bot)
-
Go to this site:
👉 https://code.visualstudio.com/ -
Click the blue button Download for Windows.
-
After download, click the installer file (named like VSCodeSetup.exe).
-
On the pop-up:
-
Click Next several times.
-
Accept the agreement when asked.
-
Leave everything default, just click Install.
-
-
After installation, check the box Launch VS Code, then click Finish.
✅ VS Code is now installed and ready.
🔹 PART 3: Write Your First Bot
-
Open VS Code:
-
Move your mouse to the desktop.
-
Double-click the icon named Visual Studio Code.
-
-
Inside VS Code:
-
Click File > New File
-
Click File again > Save As
-
Name it
mybot.py
and save it on your Desktop.
-
-
Now type this code into the file exactly:
while True:
user = input("You: ")
if user.lower() in ["hi", "hello"]:
print("Bot: Hello there!")
elif user.lower() in ["bye", "exit"]:
print("Bot: Goodbye!")
break
else:
print("Bot: I didn’t understand that.")
-
Click File > Save.
🔹 PART 4: Run Your Bot
-
Press your keyboard keys:
[Ctrl] + [`] (that’s the backtick key next to [1] on your keyboard)🔹 This opens a terminal at the bottom of VS Code.
-
Now type this in the terminal:
python mybot.py
-
Press [Enter].
Now talk to your bot!
-
Type hi → it replies “Hello there!”
-
Type bye → it says “Goodbye!” and ends.
-
Type anything else → it says it didn’t understand.
🔧 TROUBLESHOOTING
-
If "python" is not recognized:
You forgot to check Add Python to PATH during install.
Fix: Uninstall Python, reinstall, and this time tick that box. -
If VS Code doesn’t show a terminal:
Click Terminal at the top → New Terminal
CHECKPOINT
Did you see the bot respond when you typed hi or bye?
If not, tell me:
-
What step didn’t work?
-
What did you see instead?
Comments
Post a Comment