本文介绍了AttributeError:模块“ discord”没有属性“ Embed”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

embed=discord.Embed(title="Commands - Type '/help [command prefix]' for command info!", color=0xff0d13)
embed.set_footer(text="!blacklist, !clean, !clear, !disconnect, !id, !joinserver, !listids, !np, !pause, !perms, !play, !pldump, !queue, !restart, !resume, !search, !setavatar, !setname, !setnick, !shuffle, !shutdown, !skip, !summon, !volume")
await self.bot.say(embed=embed)

,但我不断收到此错误消息:

and I keep getting this error:

AttributeError: module 'discord' has no attribute 'Embed'

但是我不知道是什么原因造成的;我尝试再次安装 discord.py ,但这仍然会发生..它与代码本身还是其他有关?

But I don't know whats causing it; I have tried installing discord.py again but this still happens.. is it to do with the code itself or something else?

推荐答案

您的问题很可能是由于您将该文件或其他文件命名为 discord.py 。要解决此问题,只需将文件重命名为其他名称即可。也许 run.py 之类的东西?

Your problem is most likely cause by you naming that file or some other file somewhere in your path to discord.py. To fix it, just rename your file to something else. Maybe run.py or something?

这篇关于AttributeError:模块“ discord”没有属性“ Embed”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 10:32