remake again

main
pupuupup 5 years ago
parent b66d51bce6
commit 29050ec7ad

@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-
import requests import requests
import logging import logging
import telegram import telegram
from telegram.ext import Updater, CommandHandler from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import time import time
import os import os
import pause, datetime import pause, datetime
@ -15,7 +17,7 @@ _apikey = os.environ["ETHERSCAN_API_KEY"]
_chainlink = '0x514910771af9ca656af840dff83e8264ecf986ca' _chainlink = '0x514910771af9ca656af840dff83e8264ecf986ca'
_url = 'https://etherscan.io/token/'+_chainlink+'?a=' _url = 'https://etherscan.io/token/'+_chainlink+'?a='
_whale = [ _whale = [
{'address': '0x75398564ce69b7498da10a11ab06fd8ff549001c', 'amount': 55000000}, {'address': '0x75398564ce69b7498da10a11ab06fd8ff549001c', 'amount': 0},
{'address': '0x5560d001f977df5e49ead7ab0bdd437c4ee3a99e', 'amount': 0}, {'address': '0x5560d001f977df5e49ead7ab0bdd437c4ee3a99e', 'amount': 0},
{'address': '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6', 'amount': 0}, {'address': '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6', 'amount': 0},
{'address': '0xe0362f7445e3203a496f6f8b3d51cbb413b69be2', 'amount': 0}, {'address': '0xe0362f7445e3203a496f6f8b3d51cbb413b69be2', 'amount': 0},
@ -25,10 +27,8 @@ _whale = [
full = "50,000,000" full = "50,000,000"
def watch(): def watch():
whale = {} whale = _whale.copy()
whale = updateQuantities(_whale) prevWhale = whale.copy()
prevWhale = _whale.copy()
#prevWhale = whale.copy()
while True: while True:
whale = updateQuantities(whale) whale = updateQuantities(whale)
dumpedAmount = getDumpedAmount(whale, prevWhale) dumpedAmount = getDumpedAmount(whale, prevWhale)
@ -38,29 +38,29 @@ def watch():
alert(whale, dumpedAmount, dumpedWallet) alert(whale, dumpedAmount, dumpedWallet)
time.sleep(5) time.sleep(5)
def ls(update, context):
print('wtf')
text = "🤓 List of wallet.\n\n"
texts =[]
for i in range(0,5):
texts.append("☑️ Wallet #"+str(i+1)+"\n"+url+w+"\n"+"("+"{:,}".format(int(whale[w]))+"/"+full+")\n")
text = '\n'.join(texts)
context.bot.send_message(chat_id=update.effective_chat.id, text=text)
def listen(): def check():
_dp.add_handler(CommandHandler("ls", ls, pass_args=True)) whale = _whale.copy()
_updater.start_polling() while True:
whale = updateQuantities(whale)
text = "🤓 Monthly Check-up\n\n List of wallet:\n\n"
texts =[]
for i in range(0,6):
texts.append("☑️ Wallet #"+str(i+1)+"\n"+_url+whale[i]['address']+"\n"+"("+"{:,}".format(int(whale[i]['amount']))+"/"+full+")\n")
text = text + '\n'.join(texts)
_bot.sendMessage(chat_id=_chatid, text=text)
time.sleep(30*24*60*60)
def getDumpedAmount(whale, prevWhale): def getDumpedAmount(whale, prevWhale):
total = 0 total = 0
for i in range(0,5): for i in range(0,6):
if whale[i]['amount'] < prevWhale[i]['amount']: if whale[i]['amount'] < prevWhale[i]['amount']:
total = total + (prevWhale[i]['amount'] - whale[i]['amount']) total = total + (prevWhale[i]['amount'] - whale[i]['amount'])
return total return total
def getDumpedWallet(whale, prevWhale): def getDumpedWallet(whale, prevWhale):
wallets = [] wallets = []
for i in range(0,5): for i in range(0,6):
if whale[i]['amount'] < prevWhale[i]['amount']: if whale[i]['amount'] < prevWhale[i]['amount']:
wallets.append(i) wallets.append(i)
return wallets return wallets
@ -76,8 +76,7 @@ def alert(whale, dumpedAmount, dumpedWallet):
texts.append("☑️ Wallet #"+str(i+1)+"\n"+_url+whale[i]['address']+"\n"+"("+"{:,}".format(int(whale[i]['amount']))+"/"+full+")\n") texts.append("☑️ Wallet #"+str(i+1)+"\n"+_url+whale[i]['address']+"\n"+"("+"{:,}".format(int(whale[i]['amount']))+"/"+full+")\n")
texts = "\n".join(texts) texts = "\n".join(texts)
text = text + texts text = text + texts
print(text) _bot.sendMessage(chat_id=_chatid, text=text)
#_bot.sendMessage(chat_id=_chatid, text=text)
def updateQuantities(whale): def updateQuantities(whale):
new = [] new = []
@ -95,18 +94,17 @@ class watcher(Thread):
def run(self): def run(self):
watch() watch()
class listener(Thread): class checker(Thread):
def __init__(self): def __init__(self):
Thread.__init__(self) Thread.__init__(self)
self.daemon = True self.daemon = True
self.start() self.start()
def run(self): def run(self):
listen() check()
_dp.add_handler(CommandHandler("ls", ls))
_updater.start_polling()
watcher() watcher()
listener() checker()
while True: while True:
pass pass

Loading…
Cancel
Save