小编Ach*_*xy_的帖子

如何通过直接修改IDENTIFY数据包来获取discord bot的移动状态?

显然,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)

python python-3.x discord discord.py pycord

10
推荐指数
2
解决办法
4771
查看次数

解析环境文件

如何在.env文件中安全存储密码和 API 密钥并正确解析它们?使用Python?

我想存储我不想推送到公共存储库的密码。

python secret-key python-3.x

6
推荐指数
1
解决办法
9347
查看次数

标签 统计

python ×2

python-3.x ×2

discord ×1

discord.py ×1

pycord ×1

secret-key ×1