Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wlstp8473
/
telegram_Messenger_Chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
wlstp8473
2021-05-25 05:56:18 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
acde8d313c54481c947889f603e813d7f416ae02
acde8d31
1 parent
55648aa2
respond.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
respond.py
respond.py
View file @
acde8d3
# https://blog.psangwoo.com/coding/2018/01/09/python-telegram-bot-3.html
# https://blog.psangwoo.com/coding/2018/01/09/python-telegram-bot-3.html 기초명령어
#텔레그렘 이용해서 코로나 챗봇 https://py-son.tistory.com/8
#https://beomi.github.io/2017/01/20/HowToMakeWebCrawler/ 크롤링 자료
import
requests
#웹에서 정보 가져오기
from
bs4
import
BeautifulSoup
from
telegram.ext
import
Updater
,
MessageHandler
,
Filters
from
telegram.ext
import
Updater
,
MessageHandler
,
Filters
updater
=
Updater
(
token
=
"1721885449:AAHDGMbjSJfhXxML6nfSCpfiU7SghpL_vOE"
)
updater
=
Updater
(
token
=
"1721885449:AAHDGMbjSJfhXxML6nfSCpfiU7SghpL_vOE"
,
use_context
=
True
)
dispatcher
=
updater
.
dispatcher
updater
.
start_polling
()
...
...
@@ -19,22 +25,35 @@ def handler(update, context):
elif
'ㅎㅎ'
in
text
:
update
.
message
.
reply_text
(
"ㅎㅎ"
)
elif
'밥 먹었어?'
in
text
:
elif
'밥 먹었어?'
==
text
:
update
.
message
.
reply_text
(
"나 아직 못 먹었어 ㅠㅠ, 진세는 밥 먹었어?"
)
elif
'먹었어'
in
text
:
elif
'먹었어'
==
text
:
update
.
message
.
reply_text
(
"우왕 뭐 먹었어?"
)
elif
'안 먹었
엉
'
in
text
:
elif
'안 먹었
어
'
in
text
:
update
.
message
.
reply_text
(
"헐헐 어쩌다?, 같이 뭐라도 먹을래?"
)
elif
'같이 먹
자
'
in
text
:
elif
'같이 먹
을까?
'
in
text
:
update
.
message
.
reply_text
(
"웅웅 집앞으로 나와"
)
elif
'사랑해'
in
text
:
update
.
message
.
reply_text
(
"내가 더 사랑해 ❤"
)
elif
'잘자'
in
text
:
elif
'잘자'
==
text
:
update
.
message
.
reply_text
(
"웅웅, 진세 너두 잘자 ㅎㅎ"
)
#########################################
elif
'멜론 1위 노래 들어봤어?'
in
text
:
update
.
message
.
reply_text
(
"잠깐 찾아볼게"
)
#update.message.reply_text("아 그 xxx 노래?")
elif
'내일 날씨 어때?'
in
text
:
update
.
message
.
reply_text
(
"잠깐만"
)
#update.message.reply_text("잠깐만")
else
:
update
.
message
.
reply_text
(
"응?"
)
...
...
@@ -42,3 +61,6 @@ def handler(update, context):
echo_handler
=
MessageHandler
(
Filters
.
text
,
handler
)
#업데이터를 통해서 필터된 텍스트가 """핸들러로 전달됨"""
dispatcher
.
add_handler
(
echo_handler
)
...
...
Please
register
or
login
to post a comment