aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-12-17 00:32:34 +0400
committerGravatar GitHub <[email protected]>2021-12-17 00:32:34 +0400
commitec6eb2e3ce4d2f0a4c3917f9eff00266a6ecf894 (patch)
tree40a96360678a06b61c6576b0c6e746c7299222dc /bot
parentminor: allow color command in dev-media (#944) (diff)
parentDouble quotes (diff)
Merge PR #978 - Added user's score to Candy Command
Added the user's score to Candy Command according to #947 Co-authored-by: Shivansh-007 <[email protected]> Co-authored-by: Tim Kao <[email protected]>
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/holidays/halloween/candy_collection.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bot/exts/holidays/halloween/candy_collection.py b/bot/exts/holidays/halloween/candy_collection.py
index bb9c93be..729bbc97 100644
--- a/bot/exts/holidays/halloween/candy_collection.py
+++ b/bot/exts/holidays/halloween/candy_collection.py
@@ -187,6 +187,12 @@ class CandyCollection(commands.Cog):
for index, record in enumerate(top_five)
) if top_five else "No Candies"
+ def get_user_candy_score() -> str:
+ for user_id, score in records:
+ if user_id == ctx.author.id:
+ return f"{ctx.author.mention}: {score}"
+ return f"{ctx.author.mention}: 0"
+
e = discord.Embed(colour=discord.Colour.og_blurple())
e.add_field(
name="Top Candy Records",
@@ -194,6 +200,11 @@ class CandyCollection(commands.Cog):
inline=False
)
e.add_field(
+ name="Your Candy Score",
+ value=get_user_candy_score(),
+ inline=False
+ )
+ e.add_field(
name="\u200b",
value="Candies will randomly appear on messages sent. "
"\nHit the candy when it appears as fast as possible to get the candy! "