Telegram-InstaPy-Scheduling is bot for telegram which helps user to schedule InstaPy.
- python-telegram-bot
- InstaPy working on your pc/server.
- Telegram bot token.
- Clone this repo in your InstaPy folder.
- Create a bot with @BotFather.
- Rename telegram-bot-data/config.ini.dist => telegram-bot-data/config.ini.
- Populate config.ini with your data.
[telegram]
token = token_from_botfather
[instapy]
username = instagram_username
password = isntagram_password
You can leave empty instapy section and get credentials as you prefer.
- Rename telegram-bot-data/allowed-id.txt.dist => telegram-bot-data/allowed-id.txt.
- Contact @GiveChatId_Bot and get your chat id with /chatid command
- Write your chat id inside allowed-id.txt.
- Insert your InstaPy script code inside threadRun function.
def threadRun():
try:
#################################################
# Put your instaPy code, the following it's mine ;)
#################################################
# Get instagram data from config.ini
insta_username = config.get('instapy', 'username');
insta_password = config.get('instapy', 'password');
# Login
session = InstaPy(username=insta_username, password=insta_password, nogui=True)
session.login()
# Like
hashtags = ["#telegram"]
session.like_by_tags(hashtags, amount=5)
session.end()
except:
import traceback
print(traceback.format_exc())
- Launch telegram-instapy.py.
Command | Parameters | Description |
---|---|---|
/set | <name> <hh:mm:ss> | Create a new schedule. Select the day from bot. |
/unset | <name> | Delete a schedule. |
Print all setted jobs | ||
/status | Print the status of InstaPy. | |
/now | Run immediately. |