This repository is a fork of Python WhatsApp Chatbot built using Selenium and some 3rd party APIs from RapidAPI originally made to talk to your DMs on Instagram and give automatic replies but this feature has been confined to a separate mode i.e. Chat Mode. The bot in Standard Mode comes with a total of 12 commands and only responds when triggered in your chats.
-
BOT_ASK something
Responds to the user using either Aeona or Harley. -
BOT_ENGLISH bonjour
Detects language and translates the passed text to English using Google Translate. -
BOT_URDU hello
Detects language and translates the passed text to Urdu using Google Translate. -
BOT_PASHTO hello
Detects language and translates the passed text to Pashto using Google Translate. -
BOT_WIKI donald trump
Searches Wikipedia for the passed argument and sends a 9 lines description of it. -
BOT_FANCY your name
Spams the DM with 24 different ASCII styled variants of passed argument. -
BOT_QUOTE
Sends a random quote of a famous personality using 'quotes' PyPi package. -
BOT_WAIFU
Sends image of an SFW Waifu (by default) using 'waifu_pypics' PyPi package. -
BOT_INSULT your name
Throws a random insult of the name passed using 'insults.txt' in the root of your project.
Add or remove insults from 'insults.txt' and replace the generic name with XXX.
-
BOT_PICKUP
Throws a random pickup line from 'pickup.txt' in the root of your project. -
BOT_IMAGE butterfly
Sends an image of the argument passed using Google Custom Search API. -
BOT_YT lovely song
Sends link and description of the passed argument using 'youtube-search' PyPi package.
(All the commands listed here and CASE-INSENSITIVE)
Usage: main.py [Case-sensitive chat name] [OPTION]...
DESCRIPTION
Instagram command bot and chat bot.
-c, --chat
This argument is REQUIRED. It is case-sensitive so the name of chat must match with the passed argument.
-H, --headless
start bot in Headless mode. (No GUI)
-C, --chatmode=[MALE|FEMALE]
start bot in Chat mode. (Respond to all messages by default)
--chat-mode=MALE : Talk to Harley
--chat-mode=FEMALE : Talk to Aeona
EXAMPLES
python main.py -c "Chat Name"
command bot is activated for chat "Chat Name".
python main.py -c "Chat Name" --chatmode=FEMALE
chat bot is activated for "Chat Name" for Aeona.
python main.py -c "Chat Name" --chatmode=MALE --headless=True
chat bot is activated for "Chat Name" for Harley in headless mode.
- Clone the repository and
cd
into it.
git clone https://github.com/raz0229/python-instagram-command-bot.git
cd python-instagram-command-bot
- Install all the dependencies
pip install -r requirements.txt
- Download Geckodriver(https://github.com/mozilla/geckodriver/releases) for your FireFox web browser.
( Mozilla Firefox browser is required )
- Sign up for RapidAPI, then create a
.env
file in the root of your project.
touch .env
In .env
file, we need to set these environment variables:
FIRST_NAME="Raz"
FIREFOX_EXECUTABLE_PATH="/usr/bin/firefox"
FIREFOX_PROFILE_LOCATION=""
GECKODRIVER_PATH=""
X_RAPIDAPI_KEY=""
AEONA_USER_ID=""
GOOGLE_CUSTOM_SEARCH_DEVELOPER_KEY=""
GOOGLE_CUSTOM_SEARCH_CX=""
OPENAI_API_KEY=""
-
To find your
X_RAPIDAPI_KEY
:
https://docs.rapidapi.com/docs/keys -
To find your
OPENAI_API_KEY
:
https://beta.openai.com/account/api-keys -
To find, your
AEONA_USER_ID
:
https://rapidapi.com/multiii/api/aeona3/ -
To find, your
GOOGLE_CUSTOM_SEARCH_DEVELOPER_KEY
andGOOGLE_CUSTOM_SEARCH_CX
:
https://console.cloud.google.com/marketplace/product/google/customsearch.googleapis.com -
FIREFOX_PROFILE_LOCATION
would be somewhere in%APPDATA%
for Windows and$HOME/.mozilla/firefox
in Linux:
https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles#w_creating-a-profile`