Development process #selfdevelopmentclub - 14/02

How to overcome stagnation an, копия (1).png

Knowledge is power.

I continue to work on the project. Knowledge is power! This slogan, if not the entire project, then invariably specifically these days of the process of working on it.

Since it is the project that motivates and gives great support for the study of books and materials. I am currently studying Man and His Symbols by Carl Gustav Jung. And it is selfdevelopmentclub that supports me in this.

So, I'm currently working on getting the bot to "recognize" the member. When entering the bot, it is necessary either that the relevant information be "mined" from the database, or that the bot ask the participant for his STEEMIT account and store it in the database.

Some of this has already been done, let's move on!
For now we need:

"Login" button
"Count" button
and "Rating" button

I'm getting started.


@bot.message_handler(commands=['start'])
def start(message):

    sqliteConnection = sqlite3.connect('selfdevelopmentclub.db')
    cursor = sqliteConnection.cursor()
    print("Connected to selfdevelopmentclub")

    sqlite_select_query = """SELECT * from users where user_id = ?"""
    cursor.execute(sqlite_select_query, (221901211,))
    readSingleRow(221901211)
    print("Reading single row \n")
    record = cursor.fetchone()
    print("Id: ", record[0])
    print("Name: ", record[1])

    cursor.close()
    
    markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
    btn1 = types.KeyboardButton("🔥 LOGIN")
    btn2 = types.KeyboardButton("Quests")
    btn3 = types.KeyboardButton("Count")
    btn4 = types.KeyboardButton("Contacts/help")
    btn5 = types.KeyboardButton("Public offer")
    btn6 = types.KeyboardButton("About us")
    markup.add(btn1, btn2, btn3, btn4, btn5, btn6)
    bot.send_message(message.chat.id, text='Hello {0.first_name}! I am a bot for the "#selfdevelopmentclub" project, sent to the project description: https://steemit.com/hive-153970/@alexmove/once-again-about-self-development-club. It turns out we can already count a lot of benefits: STUDY, BLOGGING, DATING, and, of course, the opportunity to receive a reward, EARN.: @alexmove12345'.format(message.from_user), reply_markup=markup)

@bot.message_handler(content_types=['text'])
def func(message):
    con = lite.connect('selfdevelopmentclub.db')
    with con:
        cur = con.cursor() 
        ser = message.chat.id
        link = message.text
        cur.execute (f'INSERT INTO users (user_id,steemit) VALUES ({ser}, "{link}")')
    print ('sdfsdf')   
    ser = message.chat.id
    link = message.text
    cur.execute (f'INSERT INTO status (user_id,status) VALUES ({ser}, "0")')    
    #bot.send_message(message.chat.id,    'Thank you')
    if(message.text == "Quests"):
        markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
        btn1 = types.KeyboardButton("Post")
        btn2 = types.KeyboardButton("Upvotes")
        btn3 = types.KeyboardButton("Comments")
        back = types.KeyboardButton("Back to main menu")
        markup.add(btn1, btn2, btn3, back)
        bot.send_message(message.chat.id, text="Please make your choice", reply_markup=markup)
#START LOGIN
    elif(message.text == "🔥 LOGIN"):
        ser = message.chat.id
        link = message.text
        cur.execute (f'INSERT INTO status (user_id,status) VALUES ({ser}, "1")')  
        bot.send_message('221901211',message.chat.username)
        con = lite.connect('selfdevelopmentclub.db')
        with con:
            cur = con.cursor() 
            cur.execute(f"SELECT user_id FROM users WHERE user_id = '{message.chat.id}'")
            if cur.fetchone() is None:

                test="Please enter your nickname in STEEMIT. If you do not have an account, then please register: https://signup.steemit.com/"
                con.commit()
            else:
               
                test="Your STEEMIT account is:" 
                #cur.fetchone()
                print(cur.fetchone())

                for value in cur.execute("SELECT * FROM users"):
                    print(value)
                    bot.send_message(message.chat.id, value)
        markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
        btn1 = types.KeyboardButton("Unlink account")
        back = types.KeyboardButton("Back to main menu")
        markup.add(btn1, back)
        bot.send_message(message.chat.id, text=test, reply_markup=markup)
#END LOGIN

Thank you for your attention!
In the near future there will be a new post with a continuation of the description of the development of the project.

Have a nice day!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 64241.02
ETH 3178.09
USDT 1.00
SBD 3.85