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