From ef63a04e4f4aa9003a456470ca548dc05927ad72 Mon Sep 17 00:00:00 2001 From: Kreusada Ignad Amredes <67752638+Kreusada@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:04:45 +0000 Subject: [PATCH] [Flags] v1.1.6 Fix `[p]flagemojis` --- flags/flags.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/flags/flags.py b/flags/flags.py index 6bc4cc929..5ddde7cab 100644 --- a/flags/flags.py +++ b/flags/flags.py @@ -123,7 +123,7 @@ async def convert(self, ctx: Context, argument: str) -> Optional[Dict[str, Union class Flags(Cog): """Get flags from country names.""" - __version__ = "1.1.5" + __version__ = "1.1.6" __author__ = "Kreusada" def __init__(self, bot: Red): @@ -205,13 +205,7 @@ async def flagemojis(self, ctx: commands.Context, *countries: CountryConverter): """ if not countries: return await ctx.send_help() - # Here, I am removing duplicates. Cannot do set(countries) - # because set takes hashable objects of which dict is not - # using dict.fromkeys() instead of set() to retain insertion order - unique_countries = [ - dict(s) for s in dict.fromkeys(frozenset(d.items()) for d in countries) - ] - message = "\n".join(f"{c['Emoji']} - `{c['Emoji']}`" for c in unique_countries) + message = "\n".join(f"{c['Emoji']} - `{c['Emoji']}` ({c['Name']})" for c in countries) for page in pagify(message): await ctx.send(page)