显然,discord 机器人可以具有移动状态,而不是默认获得的桌面(在线)状态。
经过一番挖掘后,我发现这种状态是通过修改 的值来实现的,IDENTIFY packet或者discord.gateway.DiscordWebSocket.identify理论上应该$browser让我们获得移动状态。Discord AndroidDiscord iOS
修改我在网上找到的执行此操作的代码片段后,我最终得到以下结果:
def get_mobile():
"""
The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
Discord uses that information to know when your phone client and only your phone client has connected to Discord,
from there they send the extended presence object.
The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
the mobile …Run Code Online (Sandbox Code Playgroud) 如何在.env文件中安全存储密码和 API 密钥并正确解析它们?使用Python?
我想存储我不想推送到公共存储库的密码。