def refresh_stdout_on_telegram():
old_lines = ''
# TODO add command buttons
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton('stop terminal',
callback_data=' s')]])
while term.is_started_real_terminal:
sleep(0.1)
if old_lines == term.text_stdout: # no changes...
continue
old_lines = term.text_stdout
bot_.edit_message_text(chat_id=last_chat_id,
message_id=last_message_id,
text=old_lines+'_',
reply_markup=reply_markup)
评论列表
文章目录