Advertisement
Paceusa

Clickbot Script (2022)

Jan 27th, 2022 (edited)
697
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Donator Groups
  2.  
  3. import asyncio
  4. import logging
  5. import re
  6. import time
  7. import os
  8. import sys
  9. import requests
  10.  
  11. logging.basicConfig(level=logging.ERROR)
  12.  
  13. from telethon.tl.types import UpdateShortMessage,ReplyInlineMarkup,KeyboardButtonUrl
  14. from telethon import TelegramClient, events
  15. from telethon.tl.functions.channels import JoinChannelRequest
  16. from telethon.tl.functions.messages import GetBotCallbackAnswerRequest
  17. from datetime import datetime
  18. from colorama import Fore, init as color_ama
  19. from bs4 import BeautifulSoup
  20.  
  21. color_ama(autoreset=True)
  22.  
  23. os.system('cls' if os.name=='nt' else 'clear')
  24.  
  25. # Get your own values from my.telegram.org
  26. api_id = 800812
  27. api_hash = 'db55ad67a98df35667ca788b97f771f5'
  28.  
  29. # WELCOME BLOCK
  30. print(Fore.MAGENTA + '      __      _____ _    ___ ___  __  __ ___ ')
  31. print(Fore.MAGENTA + '      \ \   / / __| |  / __/ _ \|  \/  | __|')
  32. print(Fore.MAGENTA + '       \ \/\/ /| _|| |_| (_| (_) | |\/| | _| ')
  33. print(Fore.MAGENTA + '        \_/\_/ |___|____\___\___/|_|  |_|___|\n' + Fore.RESET)
  34. print(Fore.RED + '   -                   Click Bot Script v4                 -' + Fore.RESET)
  35. print('')
  36. print(Fore.YELLOW + '   -               Pastebin :' + Fore.RED +' Paceusa' + Fore.WHITE +'works' + Fore.YELLOW +'             -')
  37. # DESCRIPTION BLOCK
  38. print('\n        Earn money using telegram bot.\n')
  39. # Bot options
  40. print(' Options: \n')
  41. option = ["Dogecoin_click_bot", "Litecoin_click_bot", "BCH_clickbot", "Zcash_click_bot", "Bitcoinclick_bot"] #Bot option list
  42. # Print bot options list with numberings
  43. for number, letter in enumerate(option):
  44.     print(  "   ", number, letter)
  45. # Ask user to select bot
  46. ask = int(input (\n  Which bot do you want to run?" + Fore.RED + " (Number only)" + Fore.RESET + ":" ))
  47. answer = (option[ask])
  48. url_channel = answer
  49.  
  50. def print_msg_time(message):
  51.     print('[' + Fore.CYAN + f'{datetime.now().strftime("%H:%M:%S")}' + Fore.RESET + f'] {message}')
  52.  
  53. def get_response(url, method='GET'):
  54.     response = requests.request(method, url, headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win32; x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"}, timeout=15)
  55.     text_response = response.text
  56.     status_code = response.status_code
  57.     return[status_code, text_response]
  58.        
  59. async def main():
  60.     print(Fore.GREEN + url_channel + Fore.RESET + " selected.\n")
  61.     print('     DogeClick Bot Channel Actions Menu.\n')
  62.     # Bot options
  63.     print(' Options: \n')
  64.     action = ["Visit", "Message", "Join"] #Bot option list
  65.     # Print bot options list with numberings
  66.     for number, letter in enumerate(action):
  67.         print(  "   ", number, letter)
  68.     # Ask user to select bot
  69.     ask_action = int(input ("   \n  What bot's action do you want to perform?" + Fore.RED + " (Number only)" + Fore.RESET + ":" ))
  70.     answer = (action[ask_action])
  71.     bot_action = answer
  72.     if answer == action[0]:
  73.         print(action[0] + " performed")
  74.                 # Check if phone number is not specified
  75.         if len(sys.argv) < 2:
  76.             print('Usage: python start.py phone_number')
  77.             print('-> Input number in international format (example: +639162995600)\n')
  78.             e = input('Press any key to exit...')
  79.             exit(1)
  80.            
  81.         phone_number = sys.argv[1]
  82.        
  83.         if not os.path.exists("session"):
  84.             os.mkdir("session")
  85.        
  86.         # Connect to client
  87.         client = TelegramClient('session/' + phone_number, api_id, api_hash)
  88.         await client.start(phone_number)
  89.         me = await client.get_me()
  90.         ads_channel = "ziziworks"
  91.         await client(JoinChannelRequest(ads_channel))
  92.         ads_group = "ziziworksgroup"
  93.         await client(JoinChannelRequest(ads_group))
  94.         print('Current account:' + Fore.CYAN + f'{me.first_name}({me.username})\n' + Fore.RESET)
  95.         print_msg_time(Fore.YELLOW + 'Sending /visit command' + Fore.RESET)
  96.        
  97.         # Start command /visit
  98.         await client.send_message(url_channel, '/visit')
  99.        
  100.         # Start visiting the ads
  101.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  102.         async def visit_ads(event):
  103.        
  104.        
  105.             original_update = event.original_update
  106.             if type(original_update)is not UpdateShortMessage:
  107.                 if hasattr(original_update.message,'reply_markup') and type(original_update.message.reply_markup) is ReplyInlineMarkup:
  108.                     url = event.original_update.message.reply_markup.rows[0].buttons[0].url
  109.                     #url = event.message.reply_markup.rows[0].buttons[0].url
  110.                
  111.                     if url is not None:
  112.                         print_msg_time('Visiting website...')
  113.  
  114.                         # Parse the html of url
  115.                         (status_code, text_response) = get_response(url)
  116.                         parse_data = BeautifulSoup(text_response, 'html.parser')
  117.                         captcha = parse_data.find('div', {'class':'g-recaptcha'})
  118.                        
  119.                         # Captcha detected
  120.                         if captcha is not None:
  121.                             print_msg_time(Fore.RED + 'Captcha detected!'+ Fore.RED +' Skipping ads...\n')
  122.                                        
  123.                             # Clicks the skip
  124.                             await client(GetBotCallbackAnswerRequest(
  125.                                 peer=url_channel,
  126.                                 msg_id=event.message.id,
  127.                                 data=event.message.reply_markup.rows[1].buttons[1].data
  128.                             ))     
  129.            
  130.         # Print earned money
  131.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  132.         async def wait_hours(event):
  133.             message = event.raw_text
  134.             if 'You earned' in message:
  135.                 print_msg_time(Fore.GREEN + f'{message}' + Fore.RESET)
  136.         # Balance Check
  137.             #======== Start print balance
  138.         #@client.on(events.NewMessage(chats=url_channel, incoming=True))
  139.         #async def account_balance(event):
  140.             #message = event.raw_text
  141.             #if 'Available balance' in message:
  142.                 #print_msg_time(Fore.YELLOW + f'{message}\n' + Fore.RESET)
  143.             # Print earned money
  144.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  145.         async def manual_skip(event):
  146.             message = event.raw_text
  147.             if 'Skipping task...' in message:  
  148.                 print_msg_time(Fore.YELLOW + f'{message}' + Fore.RESET)
  149.         # No longer valid
  150.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  151.         async def no_valid(event):
  152.             message = event.raw_text
  153.             if 'Sorry, that task is no longer valid' in message:   
  154.                 print_msg_time(Fore.RED + 'Sorry, that task is no longer valid.' + Fore.RESET)
  155.                 print_msg_time(Fore.YELLOW + 'Sending /visit command' + Fore.RESET)
  156.                 await client.send_message(url_channel, '/visit')
  157.         # No more ads
  158.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  159.         async def no_ads(event):
  160.             message = event.raw_text
  161.             if 'no new ads available' in message:  
  162.                 print_msg_time(Fore.RED + 'Sorry, there are no new ads available\n' + Fore.RESET)
  163.                 e = input('Press any key to exit...')
  164.                 exit(1)
  165.     elif answer == action[1]:
  166.         print(action[1] + " performed")
  167.                 # Check if phone number is not specified
  168.         if len(sys.argv) < 2:
  169.             print('Usage: python start.py phone_number')
  170.             print('-> Input number in international format (example: +639162995600)\n')
  171.             e = input('Press any key to exit...')
  172.             exit(1)
  173.            
  174.         phone_number = sys.argv[1]
  175.        
  176.         if not os.path.exists("session"):
  177.             os.mkdir("session")
  178.        
  179.         # Connect to client
  180.         client = TelegramClient('session/' + phone_number, api_id, api_hash)
  181.         await client.start(phone_number)
  182.         me = await client.get_me()
  183.         ads_channel = "ziziworks"
  184.         await client(JoinChannelRequest(ads_channel))
  185.         ads_group = "ziziworksgroup"
  186.         await client(JoinChannelRequest(ads_group))
  187.         print('Current account:' + Fore.CYAN + f'{me.first_name}({me.username})\n' + Fore.RESET)
  188.         print_msg_time('Sending /bots command')
  189.        
  190.         # Start command /bots
  191.         await client.send_message(url_channel, '/bots')
  192.        
  193.         # Message the bot
  194.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  195.         async def join_start(event):
  196.             message = event.raw_text
  197.             if 'Forward a message to' in message:  
  198.                 channel_msg = event.original_update.message.reply_markup.rows[0].buttons[0].url
  199.                 print_msg_time(f'URL @{channel_msg}')
  200.                
  201.                 if '?' in channel_msg:
  202.                     channel_name = re.search(r't.me\/(.*?)\?', channel_msg).group(1)
  203.                 elif '?' not in channel_msg:
  204.                     channel_name = re.search(r't.me\/(.*?)', channel_msg).group(1)
  205.                
  206.                 print_msg_time(f'Messaging @{channel_name}...')
  207.                 await client.send_message(channel_name, '/start')
  208.                
  209.                 # Forward the bot message
  210.                 @client.on(events.NewMessage(chats=channel_name, incoming=True))
  211.                 async def earned_amount(event):
  212.                     msg_id = event.message.id,
  213.                     await client.forward_messages(url_channel, msg_id, channel_name)
  214.        
  215.         # Print earned amount
  216.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  217.         async def earned_amount(event):
  218.             message = event.raw_text
  219.             if 'You earned' in message:
  220.                 print_msg_time(Fore.GREEN + event.raw_text + '\n' + Fore.RESET)
  221.                
  222.         # No more ads
  223.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  224.         async def no_ads(event):
  225.             message = event.raw_text
  226.             if 'no new ads available' in message:  
  227.                 print_msg_time(Fore.RED + 'Sorry, there are no new ads available\n' + Fore.RESET)
  228.                 e = input('Press any key to exit...')
  229.                 exit(1)
  230.     elif answer == action[2]:
  231.         print(action[2] + " performed")
  232.                 # Check if phone number is not specified
  233.         if len(sys.argv) < 2:
  234.             print('Usage: python start.py phone_number')
  235.             print('-> Input number in international format (example: +639162995600)\n')
  236.             e = input('Press any key to exit...')
  237.             exit(1)
  238.            
  239.         phone_number = sys.argv[1]
  240.        
  241.         if not os.path.exists("session"):
  242.             os.mkdir("session")
  243.        
  244.         # Connect to client
  245.         client = TelegramClient('session/' + phone_number, api_id, api_hash)
  246.         await client.start(phone_number)
  247.         me = await client.get_me()
  248.         ads_channel = "ziziworks"
  249.         await client(JoinChannelRequest(ads_channel))
  250.         ads_group = "ziziworksgroup"
  251.         await client(JoinChannelRequest(ads_group))
  252.         print('Current account:' + Fore.CYAN + f'{me.first_name}({me.username})\n' + Fore.RESET)
  253.         print_msg_time('Sending /join command')
  254.        
  255.         # Start command /join
  256.         await client.send_message(url_channel, '/join')
  257.        
  258.         # Join the channel
  259.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  260.         async def join_start(event):
  261.             message = event.raw_text
  262.             if 'You must join' in message: 
  263.                 channel_name = re.search(r'You must join @(.*?) to earn', message).group(1)
  264.                 print_msg_time(f'Joining @{channel_name}...')
  265.                
  266.                 # Join the channel
  267.                 await client(JoinChannelRequest(channel_name))
  268.                 print_msg_time(f'Verifying...')
  269.                
  270.                 # Clicks the joined
  271.                 await client(GetBotCallbackAnswerRequest(
  272.                     peer=url_channel,
  273.                     msg_id=event.message.id,
  274.                     data=event.message.reply_markup.rows[0].buttons[1].data
  275.                 ))
  276.        
  277.         # Print waiting hours
  278.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  279.         async def wait_hours(event):
  280.             message = event.raw_text
  281.             if 'You must stay' in message: 
  282.                 waiting_hours = re.search(r'at least (.*?) to earn', message).group(1)
  283.                 print_msg_time(Fore.GREEN + f'Success! Please wait {waiting_hours} to earn reward\n' + Fore.RESET)
  284.                
  285.         # No more ads
  286.         @client.on(events.NewMessage(chats=url_channel, incoming=True))
  287.         async def no_ads(event):
  288.             message = event.raw_text
  289.             if 'no new ads available' in message:  
  290.                 print_msg_time(Fore.RED + 'Sorry, there are no new ads available\n' + Fore.RESET)
  291.                 e = input('Press any key to exit...')
  292.                 exit(1)
  293.     else:
  294.         print("You insert nothing which me no action. Exit..")
  295.         exit
  296.  
  297.    
  298.     await client.run_until_disconnected()
  299.    
  300. asyncio.get_event_loop().run_until_complete(main())
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement