Public
Like
notifyInTg
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Usage in bash:
# Can be in .bashrc or .zsrhc: to-tg() { local input="" if [[ -p /dev/stdin ]]; then input="$(cat -)" else input="${@}" fi if [[ -z "${input}" ]]; then return 1 fi local chat_id="-1001826545120" # Set chat_id where your bot is local message="$input" curl -G https://api.val.town/v1/run/dpetrouk.notifyInTg --data-urlencode 'args=["'"$chat_id"'", "'"$message"'"]' }
# You will get notification where command is succesfully finished <command in bash> && to-tg Success # Can be like that? <command in bash> | to-tg Success
