【发布时间】:2021-09-14 04:40:57
【问题描述】:
updated error image 出于某种原因,我无法调用我的命令。 RuntimeError:事件循环已关闭。我需要帮助来修复它,我是 python 编程的新手。我想学习如何在 python 上创建不和谐的机器人,所以我寻求帮助!
import discord
from discord.ext import commands
TOKEN = "TOKEN-HERE"
client = commands.Bot(command_prefix = '!')
@client.command()
async def embed(ctx):
em = discord.Embed(title="Title",description ="This is a description",color=0x20B2AA)
em.set_footer(text='This is a footer.')
em.set_image(url='')
em.set_thumbnail(url='https://cdn.discordapp.com/attachments/823480191493210113/886011319688527892/Screenshot_808.png')
em.set_author(name='Author Name', icon_url='https://cdn.discordapp.com/attachments/823480191493210113/886011319688527892/Screenshot_808.png')
em.add_field(name='Field Name', value='Field Value', inline=False)
em.add_field(name='Field Name', value='Field Value', inline=True)
em.add_field(name='Field Name', value='Field Value', inline=True)
await ctx.send(embed=em)
@client.command()
async def asnwer(ctx):
await ctx.send("Hi !")
client.run(TOKEN)
异常被忽略:
【问题讨论】:
-
您可能不想在此处发布您的个人代币,让全世界看到和滥用。我建议你现在撤销它并重新创建一个......
标签: python discord.py