问题描述
我创建了一个API,该API以HTML输出我的网站页面。一切工作正常,除了我使用以下代码Traceback (most recent call last):
File "C:\python38\lib\site-packages\discord\client.py",line 312,in _run_event
await coro(*args,**kwargs)
File "C:\Users\cuzto\Desktop\discordBot.-py\cogs\events.py",line 106,in on_message
if not message.author.permissions_in(message.channel).manage_messages:
File "C:\python38\lib\site-packages\discord\user.py",line 232,in permissions_in
return channel.permissions_for(self)
File "C:\python38\lib\site-packages\discord\channel.py",line 146,in permissions_for
base = super().permissions_for(member)
File "C:\python38\lib\site-packages\discord\abc.py",line 475,in permissions_for
roles = member.roles
AttributeError: 'User' object has no attribute 'roles'
添加的网站上的LaTex代码不会显示在API输出上,而是在网站本身上正常工作。
在API输出上,我看到LaTex代码像这样 @commands.Cog.listener()
async def on_message(self,message):
if not message.author.permissions_in(message.channel).manage_messages:
if "discord.gg" in message.content.lower():
await message.delete()
await message.channel.send(f"temp,<@{message.author.id}>")
被剥离并显示,而不是实际格式化的数学方程式或公式。
在实际站点上,MathJax被配置为使用MathJax CDN服务,而不是服务器上托管的脚本,因此我猜测API某种程度上没有向CDN发出请求。
您的建议将不胜感激。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)