Beispiel #1
0
def a(bot, update, args):
    bot.send_chat_action(chat_id=update.message.chat_id,
                         action=telegram.ChatAction.TYPING)
    if args[-1] in [
            '500', '1000', '1500', '2000', '2500', '5000', '7500', '10000',
            '12500', '15000', '17500', '20000', '25000', '30000', '35000',
            '40000', '45000', '50000'
    ]:
        num_trades = int(args[-1])
        coin_list = args[:-1]
    else:
        num_trades = 5000
        coin_list = args
    for coinName in coin_list[:4]:
        market = infolib.getMarket(coinName)
        tradelib.trade_msg_h1(client, market, num_trades)
        bot.send_photo(chat_id=update.message.chat_id,
                       photo=open(str(market) + '.png', 'rb'))
        tradelib.trade_msg_m30(client, market, num_trades)
        bot.send_photo(chat_id=update.message.chat_id,
                       photo=open(str(market) + '.png', 'rb'))
        if str(update.message.from_user.username) != ADMIN_USERNAME:
            bot.sendMessage(
                ADMIN_ID, 'chat_id: ' + str(update.message.chat_id) +
                ' username: @' + str(update.message.from_user.username) +
                ' market: /' + str(market))
def coin(bot, update, args):
    if args[-1] == '1':
        coin_list = args[:-1]
        opt = 1
    else:
        coin_list = args
        opt = 0
    for coinName in coin_list:
        market = infolib.getMarket(coinName)
        msg = tradelib.trade_analysis_500(client, market, opt)
        update.message.reply_text(msg, parse_mode=ParseMode.MARKDOWN)
Beispiel #3
0
def t(bot,update,args):
    bot.send_chat_action(chat_id=update.message.chat_id,action=telegram.ChatAction.TYPING)
    if args[-1] == '1':
        coin_list=args[:-1]
        opt=1
    else:
        coin_list=args
        opt=0
    for coinName in coin_list:
        market=infolib.getMarket(coinName)
        msg=tradelib.trade_analysis_500(client,market,opt)
        update.message.reply_text(msg,parse_mode=ParseMode.MARKDOWN)
        if opt==1:
            bot.send_photo(chat_id=update.message.chat_id, photo=open(str(market)+'.png', 'rb'))
        if str(update.message.from_user.username)!=ADMIN_USERNAME:
            bot.sendMessage(ADMIN_ID,'chat_id: '+str(update.message.chat_id)+' username: @'+str(update.message.from_user.username)+' market: /'+str(market))