Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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
Beispiel #5
0
def start_ping(update: Updater, context: CallbackContext):
    logger.info('call')
    update.message.reply_text('Please enter ip adress:')
    return Config.STARTPING
Beispiel #6
0
def start(update: Updater, context: CallbackContext):
    logger.info('call')
    update.message.reply_text('Please choose :',
                              reply_markup=get_search_keyboard())
    return Config.CHOOSING