Added mention to roll

This commit is contained in:
Twentysix 2016-04-03 21:39:50 +02:00
parent 071063d507
commit e5f6481b48

View File

@ -37,16 +37,18 @@ class General:
else: else:
await self.bot.say(randchoice(choices)) await self.bot.say(randchoice(choices))
@commands.command() @commands.command(pass_context=True)
async def roll(self, number : int = 100): async def roll(self, ctx, number : int = 100):
"""Rolls random number (between 1 and user choice) """Rolls random number (between 1 and user choice)
Defaults to 100. Defaults to 100.
""" """
author = ctx.message.author
if number > 1: if number > 1:
return await self.bot.say(":game_die: " + str(randint(1, number)) + " :game_die:") n = str(randint(1, number))
return await self.bot.say("{} :game_die: {} :game_die:".format(author.mention, n))
else: else:
return await self.bot.say("Maybe higher than 1? ;P") return await self.bot.say("{} Maybe higher than 1? ;P".format(author.mention))
@commands.command(pass_context=True) @commands.command(pass_context=True)
async def flip(self, ctx, user : discord.Member=None): async def flip(self, ctx, user : discord.Member=None):