import telepot
TELEGRAM_TOKEN ="1773638001:AAEW1PwJjgrvZmSnS_SWq91tK3W-BkYGha0"
def handler(msg):
content_type, chat_type, chat_id, msg_data, msg_id = telepot.glance(msg, long=True)
print(msg)
if content_type =="text":
bot.sendMessage(chat_id, "[반사] {}".format(msg["text"]))
bot=telepot.Bot(TELEGRAM_TOKEN)
bot.message_loop(handler, run_forever=True)
'인공지능 공부 > 남박사의 파이썬 실전' 카테고리의 다른 글
(인프런) 파이썬 실전 Server - Client , Thread 기초 (0) | 2021.06.08 |
---|---|
(인프런) 파이썬 실전 텔레그램 봇으로 환율, 날씨, 폴더목록, 파일전송 구현하기 (0) | 2021.06.07 |
( 인프런) 파이썬 실전 마그넷 크롤링 해서 자동 검색기 만들기 (0) | 2021.06.06 |
(인프런) 파이썬 실전 핫딜이 뜨면 카톡으로 알려주는 프로그램 만들기 (0) | 2021.06.06 |
(인프런) 실전 파이썬 영어기사 크롤링해서 영어단어게임 만들기 (0) | 2021.06.03 |