📌  相关文章
📜  如何在 discord.py 中创建联系开发人员命令 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:06.643000             🧑  作者: Mango

代码示例1
@client.command()
async def msgdev(ctx):
  await ctx.send("What do you want to say to the devs?")
  def check(m):
    return m.author.id == ctx.author.id

  message = await client.wait_for('message', check=check)
  await ctx.send(f'Sent message to the developer')

  user = await client.fetch_user("ID of DEVELOPER")
  
  await DMChannel.send(user, "A message from " + ctx.author.name + " from the server " + ctx.author.guild.name +  " \n" + message.content)

#In line 10 make sure to write the ID of the developer(you can get it by enabling developer mode in discord and then in any dm/server, right click your icon and click copy id)