Skip to content

rririanto/shopee-inventory-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shopee-inventory-bot

"I Make dropshiper's job easier" ~ shopee inventory bot Watch video demo

The idea inspired by my wife daily life as a dropshippers. In order to keep her store stock up-to-date, she did manual update for stocks from the suppliers store in shopee and it was quite exhausting because the more the items, the longer it takes to update them all. So as a loving husband, I came up with this simple idea to make her job easier.

The bot tasks are quite simple. Just type /update_stock_store on Telegram message and all of the stock on the spreadsheets will be updated automaticaly. After that she just need to download the updated spreadsheet and upload it using shopee mass updater

Requirements

  • python-telegram-bot pip install python-telegram-bot
  • oauth2client pip install oauth2client
  • gspread pip install gspread
  • requests pip install requests
  • python-dotenv pip install python-dotenv

Setup .env

GOOGLE_CREDENTIALS => Obtain OAuth2 credentials from Google Developers Console

TELEGRAM_TOKEN => To generate an Access Token

TELEGRAM_CHAT_ID => how to get the Chat ID

STORE_ID => https://shopee.co.id/{STORE_ID}

SPREADSHEET_NAME => Your spreadsheet name on google sheet. First go to mass update panel on shopee store, download the xlxs and upload it to google spreadsheet and copy the name of it then put it on here.

Installation

git clone https://github.com/jimmyromanticdevil/shopee-inventory-bot/
cd shopee-inventory-bot
pip install -r requirements.txt

python start_bot.py

Issues

If the code is not working, you could check the bot.log in the directory and read the error.

  • gspread.exceptions.SpreadsheetNotFound or This operation is not supported for this document', 'status': 'FAILED_PRECONDITION' please make sure you save the file as googlespreadsheet not as google drive. convert the spreadsheet by going to File> Save as Google Sheet.

  • caused error ('Unexpected credentials type', None, 'Expected', 'service_account') please make sure to follow this step to create correct service acount. https://gspread.readthedocs.io/en/latest/oauth2.html

Learn More

You can learn more about telegram-bot in the Here and Here

To learn gspread, check out Here