[英]How do I get the user who wrote the bot command? Discord.py
How do I get the user who wrote the bot command?如何获取编写 bot 命令的用户? So the author of the message.
所以消息的作者。
Code:代码:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix='!')
@client.event
async def on_ready():
print('Bot wurde gestartet: ' + client.user.name)
#wts
@client.command()
async def wts(ctx,name_schuh,preis,festpreis,url):
channel = client.get_channel(693503741156130897)
embed=discord.Embed(title="WTS", description= "@USER", color=0x00ff00)
embed.add_field(name="**Sneaker:** ", value= name_schuh)
embed.add_field(name="**Price:** ", value=preis)
embed.add_field(name="**Negotiable:** ", value=festpreis)
embed.set_thumbnail(url= url)
await channel.send( embed = embed)
ctx.author
will give you the Member
that sent the message. ctx.author
会给你发送消息的Member
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.