Skip to content

Commit

Permalink
[Quotes] v1.3.1 Fix SSL and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreusada committed Nov 23, 2024
1 parent bba6014 commit aa2ff22
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions quotes/quotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Quotes(commands.Cog):
"""Get a random quote."""

__version__ = "1.3.0"
__version__ = "1.3.1"
__author__ = "Kreusada"

def __init__(self, bot: Red):
Expand All @@ -32,10 +32,6 @@ async def red_delete_data_for_user(self, **kwargs):
async def quote(self, ctx: commands.Context):
"""Get a random quote."""
await ctx.typing()
try:
async with self.session.get(self.api) as r:
content = await r.json()
except ssl.SSLCertVerificationError:
await ctx.send(warning("Unable to connect to the quotes API."))
return
async with self.session.get(self.api, ssl=False) as r:
content = (await r.json())[0]
await ctx.send(f"From **{content['a']}**\n{content['q']}")

0 comments on commit aa2ff22

Please sign in to comment.