Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #1052

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 07_web_endpoints/discord_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# [`@asgi_app`](https://modal.com/docs/guide/webhooks#serving-asgi-and-wsgi-apps) decorator.

# As our example service, we hit a simple free API:
# the [Free Public API API](https://www.freepublicapis.com/api),
# the [Free Public APIs API](https://www.freepublicapis.com/api),
# a directory of free public APIs.

# [Try it out on Discord](https://discord.gg/PmG7P47EPQ)!
Expand All @@ -37,16 +37,16 @@

app = modal.App("example-discord-bot", image=image)

# ## Hit the Free Public API API
# ## Hit the Free Public APIs API

# We start by defining the core service that our bot will provide.

# In a real application, this might be [music generation](https://modal.com/docs/examples/musicgen),
# a [chatbot](https://modal.com/docs/examples/chat_with_pdf_vision),
# or [interactiving with a database](https://modal.com/docs/examples/covid_datasette).
# or [interacting with a database](https://modal.com/docs/examples/covid_datasette).

# Here, we just hit a simple free public API:
# the [Free Public API](https://www.freepublicapis.com) API,
# the [Free Public APIs](https://www.freepublicapis.com) API,
# an "API of APIs" that returns information about free public APIs,
# like the [Global Shark Attack API](https://www.freepublicapis.com/global-shark-attack-api)
# and the [Corporate Bullshit Generator](https://www.freepublicapis.com/corporate-bullshit-generator).
Expand Down Expand Up @@ -120,7 +120,7 @@ async def send_to_discord(payload: dict, app_id: str, interaction_token: str):
print("🤖 Discord response: " + await resp.text())


# Other parts of our application might want to both hit the Free Public API API and send the result to Discord,
# Other parts of our application might want to both hit the Free Public APIs API and send the result to Discord,
# so we both write a Python function for this and we promote it to a Modal Function with a decorator.

# Notice that we use the `.local` suffix to call our `fetch_api` Function. That means we run
Expand Down