擅长:python、mysql、java
<p>当Python已经向您提供以下内容时,不要尝试重新实现搜索要删除的项:</p>
<pre class="lang-py prettyprint-override"><code>with open('guilds.yaml', 'r+') as guild_remove:
content = yaml.safe_load(guild_remove)
content["connected_guilds"].remove(guild_id)
guild_remove.seek(0)
yaml.dump(content, guild_remove)
guild_remove.truncate()
</code></pre>