Skip to content

Commit

Permalink
updating iquote with a custom file hosted on gist
Browse files Browse the repository at this point in the history
  • Loading branch information
vikramisdev committed Aug 20, 2024
1 parent 76d336f commit 84530b0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions main/core/methods/functions/syncpart.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import time
import math
import random
import datetime
import html
import inspect
Expand Down Expand Up @@ -267,10 +268,21 @@ def animeQuote(
app.quote()
"""

results = requests.get("https://animechan.vercel.app/api/random", timeout=5).json()
msg = f"❝ {results.get('quote')} ❞"
msg += f" [ {results.get('anime')} ]\n\n"
msg += f"- {results.get('character')}\n\n"
anime_quote_url = "https://gist.github.com/vikramisdev/7a53a8eaac465ad065d2fd90faef55cc"
msg = ""

r = list(requests.get(anime_quote_url, timeout=5).json())
random_index = random.randint(0, len(r) - 1)
results = r[random_index]


if results is not None:
msg += f"❝ {results.get('quote')} ❞"
msg += f" [ {results.get('anime')} ]\n\n"
msg += f"- {results.get('character')}\n\n"
else:
msg = "No Quotes Found"

return msg


Expand Down

0 comments on commit 84530b0

Please sign in to comment.