Skip to content

Commit e84c1d6

Browse files
committed
add ability to check other users'scores
1 parent 21fa7c4 commit e84c1d6

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

protobot.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#####################################
2525
#
2626
COMMAND_PREFIX = '!' #
27-
VERSION = "v0.3.3-alpha" #
27+
VERSION = "v0.3.4-alpha" #
2828
ACTIVITY = discord.Game("!help") #
2929
LOG_LEVEL = logging.INFO #
3030
#
@@ -205,12 +205,19 @@ async def on_message(message):
205205
await bot.process_commands(message)
206206

207207

208-
@bot.command(name="score", help="Displays your current server score.")
208+
@bot.command(name="score", help="Displays your current score, or someone else's score if mentioned")
209209
async def check_user_score(ctx):
210-
uuid = ctx.message.author.id
211-
score = get_user_score(uuid)
210+
if (ctx.message.mentions == []):
211+
uuid = ctx.message.author.id
212+
score = get_user_score(uuid)
213+
await ctx.message.channel.send(f"Score for <@{uuid}>: {score}")
214+
else:
215+
for user in ctx.message.mentions:
216+
uuid = user.id
217+
score = get_user_score(uuid)
218+
await ctx.message.channel.send(f"Score for <@{uuid}>: {score}")
212219

213-
await ctx.message.channel.send(f"Score for <@{uuid}>: {score}")
220+
214221

215222

216223
@bot.command(name="correct", help="Sends correct.png")

0 commit comments

Comments
 (0)