Skip to content

Commit

Permalink
Merge pull request #41 from UMLCloudComputing/noah-add-dog-command
Browse files Browse the repository at this point in the history
feat: add a dog command (code was written by @noahshayne)
  • Loading branch information
ultralapse authored Jun 13, 2024
2 parents 5572194 + 8326758 commit ba4fd78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def interact(raw_request):
# Fun little command that prints pizza.
elif command_name == "pizza":
message_content = "PIZZA! 🍕🍕🍕🍕🍕"

elif command_name == "dog":
message_content = dog()
# Fire back a response to the user by making a json request
response_data = {
"type": 4,
Expand Down Expand Up @@ -128,3 +129,10 @@ def update(message, token):

print("Response status code: ")
print(response.status_code)

def dog():
page = requests.get("https://dog.ceo/api/breeds/image/random").json()
if page["status"] != "success":
return "No dog :("
get_dog = page["message"]
return get_dog

0 comments on commit ba4fd78

Please sign in to comment.