python - Discord.py 自我机器人
问题描述
我正在制作一个自我机器人,我想做点什么。我希望我的机器人阅读嵌入的描述,然后回复。
actual bot:
Field = "What color is the sky?" , Value = "1. Blue 2. Red 3. Pink"
Self Bot:
1. Blue
我不知道从哪里开始
解决方案
我不确定我是否完全理解你在说什么,因为这个例子很不清楚。我建议先阅读文档。但是,如果您想做的只是阅读嵌入字段,您可以试试这个
@client.event
async def on_message(message):
embeds = message.embeds
for embed in embeds:
print(embed.to_dict())
推荐阅读
- python - 格式错误的结果以 JSON 格式保存
- c - 打印正确数量的相同字符的问题。C中的RLE
- memory-management - 更改 PTE 中的 PFN 时延迟 Linux 内核恐慌
- mongodb - 如何使用 interface{} 动态查询 mongodb
- performance - ElasticSearch:query_string '*' 通配符 VS 前缀查询
- docker - 无法在 docker windows 容器内访问互联网
- python - 在 wxPython 面板中加载新图像时,Matplotlib RectangleSelector 消失
- c++ - C++ 模板 - 返回类型中的参数 - ';' 之前的意外标记
- javascript - 如何将css属性添加到材料设计按钮?
- laravel - 如何在 Laravel 中为 Excel 文件添加密码