Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- instabot example
- Workflow:
- 1) Ask Message type
- 2) Load messages CSV (if needed)
- 3) Send message to each users
- """
- import csv
- import os
- import sys
- import time
- import random
- import schedule
- from tqdm import tqdm
- sys.path.append(os.path.join(sys.path[0], '../'))
- from instabot import Bot
- messagesToSend = 1000
- banDelay = (864000 / messagesToSend)
- bot = Bot()
- bot.login()
- def execute():
- a = ["hey", "hello bro", "thanks for following", "whatsup" , "you good" , "boop", ]
- #messone = 'hello'
- # messtwo = 'hi'
- # messthree = 'thanks for following'
- # messfour = 'hey'
- # randomize = random.randint(0,3)
- # if randomize == 0:
- # directMessage = messone
- # if randomize == 1:
- # directMessage = messtwo
- # if randomize == 2:
- # directMessage = messthree
- # if randomize == 3:
- # directMessage = messfour
- # new method
- with open("cmfollowers.txt") as file:
- instaUsers4 = [l.strip() for l in file]
- bot.send_messages(random.choice(a),instaUsers4)
- print('Waiting ' + str(banDelay) + ' seconds...')
- time.sleep(banDelay)
- print('Sent An Individual Messages To All Users..')
- schedule.every(99999995).minutes.do(execute)
- execute()
- while True:
- schedule.run_pending()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement