engine/process.py
def show_state(self, message):
        """Return the bot state for a message/call sender,
           if there is not any state insert the initial
           one into the table and return it."""
        cursor.execute(f'select exists(select 1 from {self.db}user_state where user_id = {message.from_user.id} '
                       f'limit 1)')
        if not cursor.fetchall()[0][0]:
            cursor.execute(f"insert into {self.db}user_state values({message.from_user.id},"
                           f"'{message.from_user.first_name}', {self.states['INIT']})")
            connection.commit()

        cursor.execute(f'select user_state from {self.db}user_state where user_id = {message.from_user.id}')
        return cursor.fetchall()[0][0]
Return the bot state for a message/call sender,
           if there is not any state insert the initial
           one into the table and return it.
Return the bot state for a message/call sender,
if there is not any state insert the initial
one into the table and return it.
Return the bot state for a message / call sender if there is not any state insert the initial one into the table and return it .
def show_state(self, message):
        cursor.execute(f'select exists(select 1 from {self.db}user_state where user_id = {message.from_user.id} '
                       f'limit 1)')
        if not cursor.fetchall()[0][0]:
            cursor.execute(f"insert into {self.db}user_state values({message.from_user.id},"
                           f"'{message.from_user.first_name}', {self.states['INIT']})")
            connection.commit()
        cursor.execute(f'select user_state from {self.db}user_state where user_id = {message.from_user.id}')
        return cursor.fetchall()[0][0]
def show_state ( self , message ) : cursor . execute ( f'select exists(select 1 from {self.db}user_state where user_id = {message.from_user.id} ' f'limit 1)' ) if not cursor . fetchall ( ) [ 0 ] [ 0 ] : cursor . execute ( f"insert into {self.db}user_state values({message.from_user.id}," f"'{message.from_user.first_name}', {self.states['INIT']})" ) connection . commit ( ) cursor . execute ( f'select user_state from {self.db}user_state where user_id = {message.from_user.id}' ) return cursor . fetchall ( ) [ 0 ] [ 0 ]
Return the bot state for a message/call sender,
if there is not any state insert the initial
one into the table and return it.
Return the bot state for a message / call sender if there is not any state insert the initial one into the table and return it .
"""Return the bot state for a message/call sender,
           if there is not any state insert the initial
           one into the table and return it."""
self
message