diff --git a/redbot/cogs/general/general.py b/redbot/cogs/general/general.py index 496210582..ec7a35ac6 100644 --- a/redbot/cogs/general/general.py +++ b/redbot/cogs/general/general.py @@ -265,12 +265,13 @@ class General(commands.Cog): except aiohttp.ClientError: await ctx.send( - _("No Urban dictionary entries were found, or there was an error in the process") + _("No Urban Dictionary entries were found, or there was an error in the process.") ) return if data.get("error") != 404: - + if not data["list"]: + return await ctx.send(_("No Urban Dictionary entries were found.")) if await ctx.embed_requested(): # a list of embeds embeds = [] @@ -305,14 +306,14 @@ class General(commands.Cog): else: messages = [] for ud in data["list"]: - ud.set_default("example", "N/A") + ud.setdefault("example", "N/A") description = _("{definition}\n\n**Example:** {example}").format(**ud) if len(description) > 2048: description = "{}...".format(description[:2045]) message = _( "<{permalink}>\n {word} by {author}\n\n{description}\n\n" - "{thumbs_down} Down / {thumbs_up} Up, Powered by urban dictionary" + "{thumbs_down} Down / {thumbs_up} Up, Powered by Urban Dictionary." ).format(word=ud.pop("word").capitalize(), description=description, **ud) messages.append(message) @@ -327,6 +328,5 @@ class General(commands.Cog): ) else: await ctx.send( - _("No Urban dictionary entries were found, or there was an error in the process.") + _("No Urban Dictionary entries were found, or there was an error in the process.") ) - return