Discord Bot Python 让它创建嵌入
Discord Bot Python Having it create embdeds
您好,我想知道如何让 python 中的 discord 机器人允许用户创建嵌入文本聊天并 post 它。就像卡尔机器人一样。谢谢!
这里有一个用 discord.ext.commands
制作的例子
@client.command()
async def make_embed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await client.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await client.wait_for('message', check=check)
embed = discord.Embed(title=title.content, description=desc.content, color=0x72d345)
await ctx.send(embed=embd)
您好,我想知道如何让 python 中的 discord 机器人允许用户创建嵌入文本聊天并 post 它。就像卡尔机器人一样。谢谢!
这里有一个用 discord.ext.commands
制作的例子@client.command()
async def make_embed(ctx):
def check(message):
return message.author == ctx.author and message.channel == ctx.channel
await ctx.send('Waiting for a title')
title = await client.wait_for('message', check=check)
await ctx.send('Waiting for a description')
desc = await client.wait_for('message', check=check)
embed = discord.Embed(title=title.content, description=desc.content, color=0x72d345)
await ctx.send(embed=embd)