Discord.py: Print usernames of users who use the bot?

Created on 11 Feb 2018  路  2Comments  路  Source: Rapptz/discord.py

I'm writing my own bot and I want to be able to print the message a user says in chat when a user uses a command, and their username and ID in the console.

I already know how to get the user's ID in the console, here's my code for one of the commands.
image
And this is what is shown in the console
image

invalid

Most helpful comment

await client.send_message(
    message.channel,
    "<{0} ({1})> {2}".format(
        message.author,
        message.author.id,
        message.content
    )
)

All 2 comments

Let me get this straight...

You uppercase the user's input, then check the now-uppercased user's input, and your question is to print the user's input? I think you're overlooking something.

await client.send_message(
    message.channel,
    "<{0} ({1})> {2}".format(
        message.author,
        message.author.id,
        message.content
    )
)
Was this page helpful?
0 / 5 - 0 ratings