Beispiel #1
0
def loop(bot, config, interval, settings):
    """Schedule a BOT (by label) to run on an interval, e.g. 'MyBot -i 60'"""
    print_options(bot, config, settings)
    click.echo(f'- Interval: {interval}s')
    click.echo()
    bot_task = BotTask(bot, config)
    bot_task.run_loop(interval)
Beispiel #2
0
def abort(bot, config, settings):
    """Run the abort command of a specified BOT by label e.g. 'MyBot'"""
    print_options(bot, config, settings)
    click.echo()
    bot_task = BotTask(bot, config)
    bot_task.abort()
Beispiel #3
0
def run(bot, config, settings):
    """Run a specified BOT by label e.g. 'MyBot'"""
    print_options(bot, config, settings)
    click.echo()
    bot_task = BotTask(bot, config)
    bot_task.run_once()
Beispiel #4
0
def run_bot(event):
    event_kwargs = event.get('kwargs', {})
    bot = event_kwargs['bot']
    config = event_kwargs.get('config')
    bot_task = BotTask(bot, config, None)
    bot_task.run_once()