示例#1
0
def eosAddressReceived (bot, update):
    receivedText = update.message.text.strip()
    update.message.reply_text("Checking structure of EOS address ...")
    if checkEOSaddressStructure(receivedText) == False:
        update.message.reply_text(
            "Inserted EOS address is not correct or unknown command. \n\n"
            "   🎯Paste the valid EOS address\n"
            "    or\n"
            "   🎯Type or click /cancel to finish registration and provide to us EOS address later.")
        return ENTER_EOS_ADDRESS

    if Storage.isUserExists(update.message.from_user.id) == False:
        update.message.reply_text(
            "You are not registered in the Iryo Airdop. Register to Airdrop, then come back to add EOS address.",
        reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True), disable_web_page_preview=True)
        return NO_STATE

    #update storage
    Storage.addEOSToMainUser(update.message.from_user.id, receivedText)

    img = open('100.webp', 'rb')
    bot.send_sticker(chat_id=update.message.chat_id,
                     sticker=img,
                     reply_markup=ReplyKeyboardRemove())

    update.message.reply_text("Thank you for participating in the Iryo Airdrop campaign!\n"
                                "Your ETH and EOS addresses are correct and the pre-conditions are met.\n\n"
                                  "🎯 New referrals have been suspended!\n"
                                "Read why here: https://medium.com/p/4dfd238bf225\n\n"
                                  "You will receive  tokens after the successful ICO. Keep your eyes pegged to the alerts channel!\n\n"
                                 "And remember this is not Iryo’s final platform, you will need to move them to EOS once the migration plan is revealed!",
        reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True), disable_web_page_preview=True)
    return NO_STATE
示例#2
0
def eosAddress(bot, update):
    #temp code //no eos
    update.message.reply_text(
        "Registration of EOS address is disabled. \n    🎯Come back in in June.",
        reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True), disable_web_page_preview=True)
    return NO_STATE


    #end of: jtemp code //no eos

    if Storage.isUserExists(update.message.from_user.id) == False:
        update.message.reply_text(
            "You are not registered in the Iryo Airdop.\nRegister to Airdrop, then come back to add EOS address.",
        reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True), disable_web_page_preview=True)
        return NO_STATE

    eosAddress = Storage.isEOSAddressExists(update.message.from_user.id)
    if eosAddress != '':
        update.message.reply_text(
            "Your current registered EOS address is\n" + eosAddress + " \n\n"
            "   🎯Paste the new one to update\n"
            "    or\n"
            "   🎯Type or click /cancel to use other commands",
            reply_markup=ReplyKeyboardRemove(),
            disable_web_page_preview=True)
        return CHECK_EOS_ADDRESS

    update.message.reply_text(
            "Your haven't registered EOS address yet\n\n"
            "   🎯Paste the valid EOS address\n"
            "    or\n"
            "   🎯Type or click /cancel to use other commands.",
            reply_markup=ReplyKeyboardRemove())
    return CHECK_EOS_ADDRESS
示例#3
0
def participate(bot, update):
    if Storage.isUserExists(update.message.from_user.id):
        hashedID = calculateRefferalCode(update.message.from_user.id)
        update.message.reply_text("Your address or telegram ID already exists in database",
                                  #"     🎯Your referral code: " + hashedID + "\n\n"
                                  #                                           "You can get additional IRYO tokens by sharing your referral code. "
                                  #                                           "Every user who successfully joins the airdrop will bring you 20% additional bonus tokens. "
                                  #                                           "The number of people using your referral code is only limited by the campaign itself\n\n"
                                  #                                           "You will receive  tokens after the successful ICO. Keep your eyes pegged to the alerts channel!\n\n"
                                  #                                           "And remember this is not Iryo’s final platform, you will need to move them to EOS once the migration plan is revealed!",
                                  reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    update.message.reply_text("To participate you’ll need to do 2 things:\n\n"

                              "🎯 Join the Iryo telegram group & the alerts channel.\n"
                              "		• https://t.me/IRYOnetwork - Iryo’s primary group - join the conversation!\n"
                              "		• https://t.me/iryo_alerts - An important channel managed by the Iryo team (security alerts, contract address, etc)\n\n"

                              "🎯Tell us your valid Ethereum address on which at least one of next two conditions are true on March 1st, 2018. Block 5174125 https://etherscan.io/block/5174125\n"
                              "		• At least 0.1 ETH on your address.\n"
                              "		• At least 1 EOS token on your address.\n\n"

                              "Please enter your Ethereum address (Warning: An address from an exchange will not work, i.e Binance, Kraken etc.)",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True),
                              disable_web_page_preview=True)
    return NO_STATE
示例#4
0
def eosAddressReceivedCheck(bot, update):
    receivedText = update.message.text.strip()
    update.message.reply_text("Checking structure of EOS address ...")
    if checkEOSaddressStructure(receivedText) == False:
        update.message.reply_text(
            "Inserted EOS address is not correct or unknown command. \n\n"
            "   🎯Paste the valid EOS address\n"
            "    or\n"
            "   🎯Type or click /cancel to finish registration and provide to us EOS address later."
        )
        return CHECK_EOS_ADDRESS

    if Storage.isUserExists(update.message.from_user.id) == False:
        update.message.reply_text(
            "You are not registered in the Iryo Airdop. Register to Airdrop, then come back to add EOS address.",
            reply_markup=ReplyKeyboardMarkup(bot_keyboard,
                                             resize_keyboard=True),
            disable_web_page_preview=True)
        return NO_STATE

    #update storage
    Storage.addEOSToMainUser(update.message.from_user.id, receivedText)
    update.message.reply_text(
        "Your EOS address has been updated\n\n"
        "You will receive tokens after the successful ICO. Keep your eyes pegged to the alerts channel!\n\n",
        reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True),
        disable_web_page_preview=True)
    return NO_STATE
示例#5
0
def ethereumAddressReceived(bot, update, user_data):
    receivedText = update.message.text
    address = receivedText.strip()

    if Storage.getParticipantsCountOverLimit() == True:
        update.message.reply_text(
            "The Iryo Airdrop is complete! We distributed tokens to 22,500 participants!",
            reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    if Storage.getParticipantsCountTodayOverLimit() == True:
        update.message.reply_text(
            "Wow, slow down! We reached the 2,000 Airdrops per day limit. Come back tomorrow/today! (Timer resets at 12:00 gmt)",
            reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    update.message.reply_text("Checking structure of Ethereum address ...",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
    if (checkEthereumAddressStructure(address) == False):
        update.message.reply_text("Received address is not correct.\n" \
                                  "Please send me a correct address.",
                                  reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    update.message.reply_text("Checking previous participants IDs and addresses ...",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
    if Storage.isUserExists(update.message.from_user.id):
        hashedID = calculateRefferalCode(update.message.from_user.id)
        update.message.reply_text("Your address or telegram ID already exists in database",
                                  #"     🎯Your referral code: " + hashedID + "\n\n"
                                  #"You can get additional Iryo tokens by sharing your referral code. Every user who successfully joins the airdrop will bring you 20% worth of additional bonus tokens. The number of people using your referral code is only limited by the campaign itself.",
                                  reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    update.message.reply_text("Checking participation in Iryo group/channel ...",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))

    #isUserInGroup = checkGroup.isUserJoined(update.message.from_user.id, IRYO_GROUP)
    #IsUserInChannel = checkGroup.isUserJoined(update.message.from_user.id, IRYO_CHANNEL)
    #if (isUserInGroup == False or IsUserInChannel == False):
    #        text = ""
    #    if isUserInGroup == False and IsUserInChannel == True:
    #            text += "I can't seem to find you in the Iryo telegram group.\n" \
    #                "Join to our group ( https://t.me/IRYOnetwork ) and please send me your Ethereum address again."
    #    elif isUserInGroup == True and IsUserInChannel == False:
    #        text += "I can't seem to find you in the Iryo alerts channel.\n" \
    #                "Join to our channel ( https://t.me/iryo_alerts ) and please send me your Ethereum address again."
    #    else:
    #        text += "I can't seem to find you in either the Iryo group or in the alerts channel.\n\n" \
    #                "Please join the channel and the group below to get your Iryo tokens!\n" \
    #                "      • https://t.me/IRYOnetwork - main Iryo conversation group \n" \
    #                "      • https://t.me/iryo_alerts - important channel managed by Iryo team (security alerts, contract address, etc)\n\n" \
    #                "After joining, please send me your Ethereum address again."
    #    update.message.reply_text(text, reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True),
    #                              disable_web_page_preview=True)
    #    return NO_STATE

    hashedID = calculateRefferalCode(update.message.from_user.id)

    update.message.reply_text("Checking your balance on Ethereum address ...",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
    eosValueCode = CryptoAmount().checkEOSBallance(address)
    ethCode = CryptoAmount().getETHBalanceOnBlock(address)

    if ethCode == 0 and eosValueCode == 0:
        #Storage.addNewParticipant(update.message.from_user.id,
        #                          address,
        #                          hashedID,
        #                          True,
        #                          True)
        update.message.reply_text("Your address didn’t have enough EOS orETH on SNAPSHOT date."
                                    #"     🎯Your referral code: " + hashedID + "\n\n"
                                    #"Don't despair! You can still get Iryo tokens by sharing your referral code.\n "
                                    #"Every user who successfully joins the airdrop will bring you " + str(
                                    #BONUS) + "% of tokens(amount of tokens if you would get full airdrop portfolio). \n"
                                    #"The number of people who can use your referral code has no limit.\n"
                                    #"Every user that joins successfully brings you " + str(BONUS) + "% more tokens."
                                  ,
                                  reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE
    elif ethCode == 0 and eosValueCode == 2:
        #Storage.addNewParticipant(update.message.from_user.id,
        #                          address,
        #                          hashedID,
        #                          True,
        #                          True)
        update.message.reply_text(
            "Your address didn’t have enough ETH  and you have a confusing EOS transaction history. Please contact support.",
            #"     🎯Your referral code: " + hashedID + "\n\n"
            #                                           "Every user who successfully joins the airdrop will bring you " + str(
            #    BONUS) + "% of tokens(amount of tokens if you would get full airdrop portfolio). \n"
            #             "The number of people who can use your referral code has no limit.\n"
            #             "Every successfully user that joins brings you " + str(BONUS) + "% more tokens.",
            reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    elif ethCode == -1:
        update.message.reply_text(
            "Bot has reached the limit of requests. Please try again later.",
            reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True))
        return NO_STATE

    Storage.addNewParticipant(update.message.from_user.id,
                              address,
                              hashedID,
                              True,
                              True)

    update.message.reply_text("Thank you for participating in the Iryo Airdrop campaign!\n"
                                "Your address is correct and the pre-conditions are met.\n\n"
                                  "🎯 New referrals have been suspended!\n"
                                "Read why here: https://medium.com/p/4dfd238bf225\n\n"
                                  "You will receive  tokens after the successful ICO. Keep your eyes pegged to the alerts channel!\n\n"
                                 "And remember this is not Iryo’s final platform, you will need to move them to EOS once the migration plan is revealed!",
                              reply_markup=ReplyKeyboardMarkup(bot_keyboard, resize_keyboard=True),
                              disable_web_page_preview=True)

    #temp commented
    #update.message.reply_text("Thank you for participating in the Iryo Airdrop campaign!\n"
    #                            "Your address is correct and the pre-conditions are met.\n\n"
    #                              "Just one more thing. Please insert your EOS address (to get free Iryo token on EOS blockchain)\n"
    #                              "or\n"
    #                              "type /cancel to finish the process (and set EOS address later).\n",
    #                           reply_markup=ReplyKeyboardRemove(),
    #                            disable_web_page_preview=True)

    #temp commented
    #return ENTER_EOS_ADDRESS
    return NO_STATE