def choose_host(update: Updater, context: CallbackContext): logger.info('call') text = update.message.text logger.info(text) update.message.reply_text("Please enter host number!") return Config.CHOOSEHOST
def regular_choice(update: Update, context: CallbackContext): logger.info('call') text = update.message.text logger.info(text) update.message.delete(chat_id=update.message.chat_id, message_id=update.message.message_id) update.message.reply_text("Please enter shop name!") return Config.SEARCH
def ping(update: Updater, context: CallbackContext): logger.info('function ping') user_data = context.user_data for key, value in user_data.items(): logger.info('[{}] - [{}]'.format(key, value)) ipaddr = '192.168.%s.2' % (value) exec_comands.ExeComands().run_killall(ip_adress=ipaddr) update.message.reply_text('Please choose :', reply_markup=get_search_keyboard()) return Config.CHOOSING
def run_command(update: Updater, context: CallbackContext): host_number = update.message.text user_data = context.user_data for key, value in user_data.items(): logger.info('[{}] - [{}]'.format(key, value)) ipaddr = '192.168.%s.%s' % (value, host_number) reply_text = exec_comands.ExeComands().run_ping(ip_adress=ipaddr) update.message.reply_text(reply_text) update.message.reply_text('Please choose :', reply_markup=get_search_keyboard()) return Config.CHOOSING
def start_ping(update: Updater, context: CallbackContext): logger.info('call') update.message.reply_text('Please enter ip adress:') return Config.STARTPING
def start(update: Updater, context: CallbackContext): logger.info('call') update.message.reply_text('Please choose :', reply_markup=get_search_keyboard()) return Config.CHOOSING