python - 与 discord.embed 相关的错误
问题描述
当我运行 .py 文件时,窗口立即关闭。此时没有出现错误代码。如果我删除与 Embed 相关的代码,它会正常运行。我不确定问题是什么...
import discord, asyncio, os
from discord.ext import commands
token = "########"
game = discord.Game("&help")
bot = commands.Bot(command_prefix = '&', status = discord.Status.online, activity = game)
@bot.event
async def on_ready():
print("hi")
@bot.command()
async def help(ctx):
embed=discord.Embed(title = "기억력이 나쁜 당신에게,,," , description=f"사용 방법을 알려드립니다.", color = 0x00ff56)
embed.add_field(name="참가", value="&참가", inline=True)
embed.add_field(name="멤버 제외", value="&제외", inline=True)
embed.add_field(name="멤버 추가", value="&추가", inline=True)
embed.add_field(name="참가자 명단", value="&명단", inline=True)
embed.add_field(name="명단 초기화", value="&초기화", inline=True)
embed.add_field(name="인원수 설정", value="&인원.", inline=True)
embed.add_field(name="팀 생성", value="&생성", inline=True)
embed.add_field(name="보이스 체널 이동", value="&보이스", inline=True)
await ctx.send(embed=embed)
bot.run(token)
解决方案
尝试使用韩语以外的其他语言,这可能是问题所在。试试英文看看是不是这个问题。
推荐阅读
- android - 如何在 android 中使用 Mediacodec 解码 MPA 音频格式
- c# - 如何在asp.net(Web表单)的gridview中附加tfoot
- php - php如何改变表的背景色?
- perl - 使用 Net::SFTP::Foreign 重命名远程文件
- javascript - 尝试下载多个文件时如何检查Firebase存储中是否存在文件 - javascript
- jupyter-notebook - python pandas中用于进一步分析的url中的数据框(平均值、中位数等)没有给出正确的答案,但没有成功
- javascript - 如何通过 javasctiprt 方法获取浏览器 cookie 大小
- c++11 - 没有零拷贝的 FlatBuffers 有用吗?
- regex - “包含”时如何创建 CASE?
- fiddler - 如何在 Fiddler CustomRules.js 中遍历 JSON 响应中的数组?