telecmd

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 19 Imported by: 0

README

telecmd

A simple utility for running commands via Telegram messages.

Usage

telecmd --token '123:token' config.yaml

Configuration

Bot token can be passed with --token option or as an environment variable.

TELEGRAM_BOT_TOKEN=13256:token

Rules are defined in config.yaml

commandTimeout: 1s  # Anything parseable by time.ParseDuration
rules:
  - name: echo
    pattern: "/start"  # Regex to match incoming messages
    # workingDir: /Users/abdus/dev/ideas/payton
    command:  # Command to execute. Message text will be passed as commandline argument.
      - python3
      - -c
      - |-
        import sys
        import time
        print(sys.argv)
        text = sys.argv[2]
        time.sleep(3)
        print(f'received {text}')

TODO

  • Stream output and display progress

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL