M
M
Misha Utka2021-06-05 13:21:48
Python
Misha Utka, 2021-06-05 13:21:48

How to fix invalid literal for int() with base 10: error?

My code:

def obnoviti2(call, user_type, user_id):
      now = datetime.datetime.now()
      mess = database.sup_message(user_id)
      code = database.sup_code(user_id)
      chat_id = call.message.chat.id
      code2 = str(chat_id)[:5]
      try:
        if (code2 == code) or (call.message.chat.id == support) or (call.message.chat.id == admin):
          if user_type == 'c':
            if mess == '0':
              with sqlite3.connect("evidence.db") as con:
                cur = con.cursor()
                result = cur.execute('SELECT * FROM `sup` WHERE `id` = ?', (user_id,)).fetchall()
                for row in result:
                  username = repl(row[3])
              inline_keyboard = types.InlineKeyboardMarkup(row_width = 2)
              inline_1 = types.InlineKeyboardButton(text = " Назад", callback_data = 'nazad')
              inline_2 = types.InlineKeyboardButton(text = "✉️ Отправить сообщение", callback_data = 'otprav_mes')
              inline_3 = types.InlineKeyboardButton(text = " Изменить %", callback_data = 'izmproc')
              inline_4 = types.InlineKeyboardButton(text = " Изменить мин", callback_data = 'tmin')
              inline_5 = types.InlineKeyboardButton(text = " Изменить фразу", callback_data = 'fraza')
              inline_6 = types.InlineKeyboardButton(text = "", callback_data = 'obnoviti2')
              inline_7 = types.InlineKeyboardButton(text = "⚠️ Удалить", callback_data = 'delm1')
              inline_keyboard.add(inline_3, inline_2)
              inline_keyboard.add(inline_4, inline_5)
              inline_keyboard.add(inline_1, inline_6)
              inline_keyboard.add(inline_7)
              bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=f" Информация *{row[0]}{row[1]}*\n\nTelegram ID: *{row[2]}*\nИмя: [{row[4]}](https://t.me/{row[3]})\n\nБаланс: *{row[5]}* ₽\nФарт: *{row[7]}* %\nВсего игр: *{row[9]}*\nВыигрышей: *{row[10]}*\nПроигрышей: *{row[11]}*\nМин: *{row[12]}* ₽\n\n*Сообщение:*\n`...`\n\n`...`\n`...`\n\n *Обновлено* в {now.strftime('%H:%M:%S')} по мск", parse_mode='Markdown', disable_web_page_preview=True, reply_markup=inline_keyboard)
        else:
          bot.send_message(chat_id=call.message.chat.id, text = f" *Ошибка*", parse_mode='Markdown')
      except:
        bot.send_message(chat_id=call.message.chat.id, text = f" *Ошибка*", parse_mode='Markdown')
        pass

An error comes out:
invalid literal for int() with base 10: 'Information...'

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question