vendredi 30 mars 2018

Random number generator for python based discord bot

What I am trying to do is when someone enters the command !random (argument) I want the bot to generate a number between 1 and what they put as the argument. But whenever I try to do this it gives me around 6 different errors that are very long and make no sense to me. My current code for this command is below.

@Bot.command(pass_context=True) async def random1and10(ctx, number): arg = random.randint(1, number) if number: await Bot.say(arg) else: await Bot.say('Please select a valid number')




Aucun commentaire:

Enregistrer un commentaire