From 82b7d0c4398020616a2d26e3785ccae4b980d056 Mon Sep 17 00:00:00 2001 From: scragly <29337040+scragly@users.noreply.github.com> Date: Mon, 9 Mar 2020 17:29:48 +1000 Subject: Disambiguate codepoint value. The usage of 127462 as a unicode start point isn't super clear for other devs coming across the code in future, so assigning it to a nicely named variable with an accompanying inline comment should help make things clearer. --- bot/cogs/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py index 2003eb350..024141d62 100644 --- a/bot/cogs/utils.py +++ b/bot/cogs/utils.py @@ -271,7 +271,8 @@ class Utils(Cog): if len(options) > 20: raise BadArgument("I can only handle 20 options!") - options = {chr(i): f"{chr(i)} - {v}" for i, v in enumerate(options, start=127462)} + codepoint_start = 127462 # represents "regional_indicator_a" unicode value + options = {chr(i): f"{chr(i)} - {v}" for i, v in enumerate(options, start=codepoint_start)} embed = Embed(title=title, description="\n".join(options.values())) message = await ctx.send(embed=embed) for reaction in options: -- cgit v1.2.3