简体   繁体   中英

How to edit embed that is from another command? (discord.py)

So i want to make a suggestion system that has ?suggest ?accept and ?deny i already have the code fo ?suggest but i wanna know how to make ?deny and ?accept

import discord
from discord.ext import commands

client = commands.Bot(command_prefix='test')

@client.command()
async def suggest(ctx, suggestion):
 embed=discord.Embed(title='Suggestion by {ctx.author.mention}, description=suggestion')
 await ctx.send(embed=embed)

client.run(token)

this is the code for suggest, i want ?accept to change the color of embed to green and add a field with "accepted for reason: {reason}" same as ?deny as well, does anyone know?

To edit the message you need to get the message:

message.id

Then use: edit_message and create a new embed and put in there.

Source: Python Discordpy Is there a way to modify a message embed?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM