viewing paste Unknown #44069 | Python

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#Bot Function: Random Operator- Attack
@bot.command(name = "rop atk")
async def bot_ropatk:
    if message.content.startswith("~rop atk"):
        infile=open("attackers.txt", "r")
        count = random.randint(0, 84)
        c = 0
        line = infile.readline()
        while c != count:
            c = c + 1
            line = infile.readline()
        if c == count:
            operator = line
            msg = ("{0.author.mention}, you will be playing "+operator)
            await bot.send_message(message.channel, msg)
            infile.close()
Viewed 852 times, submitted by Guest.