Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add telegram() function to send Telegram notifications, hosting on my VPS [done] #281

Closed
kensoh opened this issue Jul 13, 2021 · 1 comment
Labels

Comments

@kensoh
Copy link
Member

kensoh commented Jul 13, 2021

This is added in v1.42, available with pip install rpa --upgrade

  1. look up @rpapybot and tap START to allow receiving messages
  2. use r.telegram(id, message) to send a Telegram message
  3. return True if message sent successfully and False otherwise
import rpa as r
r.telegram(id, message)

Developer Notes

# use the default VPS server that I host, or your own Telegram server that you host
r.telegram(1234567890, 'Sent using my VPS server endpoint https://tebel.org/rpapybot')
r.telegram(1234567890, 'Sent using your own hosted endpoint', 'https://your_endpoint')

RPA_for_Python


In addition, RPA for Python is a light and simple 1-file package with following functions written in pure Python 2/3 without Python dependencies or TagUI. They are great time-savers instead of Python users having to write their own.

load() - load text file
dump() - save text file
write() - append text file
ask() - ask for user input
wait() - wait for some time
check() - output conditionally
download() - file from URL
unzip() - unzip a zip file
run() - OS level commands
get_text() - between 2 markers
del_chars() - delete characters

.. more info at RPA for Python GitHub repo

@kensoh kensoh added the feature label Jul 13, 2021
@kensoh kensoh changed the title Sync TagUI upstream feature telegram step to send Telegram notifications - to add Jul 13, 2021
@kensoh kensoh changed the title Implement TagUI upstream telegram step to send Telegram notifications - to add Jul 18, 2021
@kensoh kensoh changed the title Implement TagUI upstream telegram step to send Telegram notifications [done] Jul 18, 2021
@kensoh kensoh changed the title Add telegram() function to send Telegram notifications using my idle VPS server [done] Jul 18, 2021
@kensoh kensoh changed the title Add telegram() function to send Telegram notifications using my VPS server [done] Jul 18, 2021
@kensoh
Copy link
Member Author

kensoh commented Jul 20, 2021

Added above commit that returns False if there is no internet or an invalid custom_endpoint is provided.

This update to handle negative edge cases is added in v1.43, available with pip install rpa --upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant