【问题标题】:Who used command in discord bot?谁在不和谐机器人中使用了命令?
【发布时间】:2021-12-31 02:11:40
【问题描述】:

所以我这里有这段代码:

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")

我想用实际使用它的人来更改“有人使用过”,但我不知道如何

【问题讨论】:

    标签: python discord bots


    【解决方案1】:

    我自己想通了,我只需要将“有人使用”替换为

    {ctx.author.name}
    

    【讨论】:

      猜你喜欢
      • 2018-11-10
      • 2018-07-21
      • 2017-05-31
      • 2021-10-21
      • 2022-01-15
      • 2021-06-17
      • 2019-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多