Skip to content

Commit

Permalink
add openplz_sound
Browse files Browse the repository at this point in the history
  • Loading branch information
baegopababjo committed May 24, 2022
1 parent c66e3c4 commit ff7b081
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions kakaobot/kakaobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def openplz():
cnt += 1

if cnt < 10000:
pygame.mixer.init()
pygame.mixer.music.load("../alarm.mp3")
pygame.mixer.music.play()
return True
else:
Expand All @@ -55,14 +57,14 @@ def hello():
@application.route("/animal",methods=['POST'])
def animal():
req = request.get_json()
usersaid = req["action"]["detailParams"]["IsOpen"]["origin"]

if usersaid == "열렸나요":
usersaid = list(req["action"]["detailParams"].keys())
usersaid = usersaid[0]
if usersaid == "IsOpen":
if isopen():
answer = "열렸습니다"
else:
answer = "닫혔습니다"
elif usersaid == "열어주세요":
elif usersaid == "Openplz":
if openplz():
answer = "컬방에 알림음을 울렸습니다."
else:
Expand Down

0 comments on commit ff7b081

Please sign in to comment.