擅长:python、mysql、java
<p>正如错误所示,<code>ctx.guild</code>是<code>None</code>。这通常发生在调用DM中的命令而不是服务器中的命令时,因为DMs中显然没有服务器</p>
<p>根据您从未使用过的<code>guild</code>变量这一事实判断,我假设您试图邀请人们加入<em>而不是</em>公会</p>
<pre class="lang-py prettyprint-override"><code># Make sure the id is an int, NOT a string
guild = client.get_guild(85184111589615208)
# Invite users to the guild with the above id instead
invite = await guild.create_invite(max_uses=1)
</code></pre>