Flux So2
Flux So2

Reputation: 55

Who used command in discord bot?

So I have this code right here:

def ConsoleCMD(self, cmd):
    print((datetime.now().strftime('%H:%M:%S')),f"\tSomeone used the '{cmd}' command!")

@commands.command()
async def ping(self, ctx):
    await ctx.send('Pong!')
    self.ConsoleCMD(self, "ping")

and i want to to change "someone used the" with actual person who used it but i dont know how

Upvotes: 2

Views: 233

Answers (1)

Flux So2
Flux So2

Reputation: 55

I figured it out myself i just had to replace "someone used the" by

{ctx.author.name}

Upvotes: 2

Related Questions