Fixing define

This commit is contained in:
Luke Robles 2022-11-21 09:27:56 -08:00
parent 55015b1110
commit f1007f5d89

View File

@ -13,7 +13,7 @@ def get_definition(word):
""" """
try: try:
definition = requests.get( definition = requests.get(
"https://api.urbandictionary.com/v0/define?term={}".format("%20".join(word)) "https://api.urbandictionary.com/v0/define?term={}".format(word)
).json()["list"] ).json()["list"]
# UD returns all the results in a json blob. Calculate which result has the highest upvotes to downvotes ratio # UD returns all the results in a json blob. Calculate which result has the highest upvotes to downvotes ratio
# as this is the result that shows up at the top on urbandictionary.com # as this is the result that shows up at the top on urbandictionary.com
@ -41,7 +41,7 @@ def get_definition(word):
definition = "No definition found" definition = "No definition found"
embed = discord.Embed( embed = discord.Embed(
description="%s:\n%s" % (" ".join(word), definition), description="%s:\n%s" % (word, definition),
color=0x428BCA, color=0x428BCA,
type="rich", type="rich",
) )