discord.py-rewrite - close() 和 logout() 方法之间的区别?

discord.py-rewrite - Difference between close() and logout() methods?

所以,要关闭与discord的连接,有两种方法:

根据文档logout() 是:

Just an alias to close(). If you want to do extraneous cleanup when subclassing, it is suggested to override close() instead.

什么是"extraneous cleanup when subclassing"?这两种方法有什么区别?

close()logout() 之间没有真正的区别。 Logout() 只是 close() 的别名。

理论上您可以互换使用它们,但最好保持一致。就个人而言,我一直使用 close,甚至不知道 Logout() 的存在。你想用哪个都行。

As you can see here, logout() literally just calls close().