【问题标题】:Discord.py Self botDiscord.py 自我机器人
【发布时间】:2021-10-07 08:39:46
【问题描述】:

我正在制作一个自我机器人,我想做点什么。我希望我的机器人阅读嵌入的描述,然后回复。

actual bot:
Field = "What color is the sky?" , Value = "1. Blue 2. Red 3. Pink"

Self Bot:
1. Blue

我不知道从哪里开始

【问题讨论】:

    标签: python discord.py


    【解决方案1】:

    我不确定我是否完全理解你在说什么,因为这个例子很不清楚。我建议先阅读the documentations。但是,如果您只想阅读嵌入字段,您可以试试这个

    @client.event
    async def on_message(message):
        embeds = message.embeds 
        for embed in embeds:
            print(embed.to_dict()) 
    

    【讨论】:

    • 这适用于普通机器人。然而,自我机器人已被 API 禁止,它们会收到一个空的消息负载,参考:discord API “soft-ban” for Selfbot? It can only read its own messages
    • 没错。我需要一种方法来为自我机器人而不是普通机器人做这件事。我还没弄明白。
    • 看看我之前回答中链接的问题。正如那里所说,由于它们已被 API 禁止,因此无法使用自我机器人进行此操作。
    • 我搞定了。它现在通过将问题与答案匹配来自动回答问题 lol
    猜你喜欢
    • 2021-08-07
    • 2021-05-03
    • 1970-01-01
    • 2021-03-29
    • 2021-10-20
    • 2021-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多