pip install python-telegram-bot

(note: do not command pip install telegram)

import telegram, sys
bot = telegram.Bot(token = 'YOUR_TOKEN')   #replace YOUR_TOKEN with yours

def send2bot(msg=sys.argv[0]):
    bot.sendMessage(chat_id='YOUR_ID', text=msg) #replace YOUR_ID with yours

send2bot()
send2bot('hello')

'LANGUAGE > Python' 카테고리의 다른 글

Statistical Visualization or Data Visualization  (0) 2019.08.23
Python Tutorials  (0) 2019.08.23
How to check whether a variable exists or not?  (0) 2019.08.01
Screen Record via CV2 and MSS  (0) 2019.07.30
Reload Module and Function in PyThon  (0) 2019.07.16

+ Recent posts