擅长:python、mysql、java
<p>如果要使用用户名,必须使用<a href="https://discordpy.readthedocs.io/en/latest/api.html#discord.utils.get" rel="nofollow noreferrer">^{<cd1>}</a>,在本例中与<a href="https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.get_guild" rel="nofollow noreferrer">^{<cd2>}</a>结合使用</p>
<pre class="lang-py prettyprint-override"><code>from discord.ext import commands
client = commands.Bot(description="a", command_prefix=".", self_bot = False)
client.remove_command('help')
@client.event
async def on_ready():
guild = client.get_guild(GUILD_ID)
user = discord.utils.get(guild.members, name="pirace", discriminator="4637")
print(user)
client.run('token')
</code></pre>