首页 > 解决方案 > 与 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)

标签: pythondiscord

解决方案


尝试使用韩语以外的其他语言,这可能是问题所在。试试英文看看是不是这个问题。


推荐阅读