Skip to content Skip to sidebar Skip to footer

Mention Author Python Bot

I need to make tag author in this line This is your random {} pick, token = 'xxxxxxxxxxxxxxxxxxxxxxxx' prefix = '?' import discord from discord.ext import commands from discord.ex

Solution 1:

Python identifiers can't begin with a number. What you can do is specify the name of the command to be something other than the name of the coroutine.

@bot.command(pass_context=True)  asyncdefchoose(ctx, k: int):
    """Chooses between multiple choices."""if0 <= k <= 10:
        await bot.say("This is your random {} pick, {}".format(k, ctx.message.author.mention))
        embed = discord.Embed(description='\n'.join(random.choices(answers, k=k)))
        await bot.say(embed=embed)
    else:
        await bot.say("Invalid number")

Solution 2:

Well this is easy!

asyncdef (ctx,k : int):

Just add ctx and you're done! Also

bot.say

Will give you error instead use

ctx.send

Post a Comment for "Mention Author Python Bot"