0
votes

I am currently having an issue trying to figure out how to make the messages give a "refreshing" status where each message deletes itself and output the updated message. Right now the bot is just outputting the messages continuously and filling up the text channel. My goal is to have the bot only show 1 embed at a time per action.

If someone can please help me with this that would be great. I have beginner experience in coding, I have taken the code from another open-source and recoded it to my current discord server needs.

Code on GitHub bot.py = https://github.com/bboychris168/Discord-Pug-bot

Image of the problem = https://scontent.fsyd6-1.fna.fbcdn.net/v/t1.15752-9/69825240_535939573844356_6171605663454593024_n.jpg?_nc_cat=104&_nc_oc=AQk69V3n7IKC3P7yxFyYAfV55ImbulX1t3Y1MM4mC-PEN8AtPdfA4kTO9UIO0lr2O-4&_nc_ht=scontent.fsyd6-1.fna&oh=a962540289fab983b6a2cdf665196356&oe=5E308D83

*ps, i know my code has alot of things wrong with it and can be improved alot.

if(pickNum == 2 or pickNum == 4 or pickNum == 6 or pickNum == 8):
            embed = discord.Embed(color=0x03f0fc)
            embed.add_field(name="**????CT**\n", value="????" + firstCaptain.mention, inline=True)
            embed.add_field(name="**Players** \n", value=" \n ".join(str(x.name) for x in readyUsers), inline=True)
            embed.add_field(name="**????T** \n", value="`Other captain pick`", inline=True) 
            embed.set_footer(text=".pick @user to pick player", icon_url="https://i.imgur.com/gVX3yPJ.gif")
            await message.channel.send("????" + firstCaptain.mention, embed=embed)
        else:
            embed = discord.Embed(color=0x03f0fc)
            embed.add_field(name="**????CT**\n", value="`Other captain pick`", inline=True)
            embed.add_field(name="**Players** \n", value=" \n ".join(str(x.name) for x in readyUsers), inline=True)
            embed.add_field(name="**????T** \n", value="????" + secondCaptain.mention, inline=True) 
            embed.set_footer(text=".pick @user to pick player", icon_url="https://i.imgur.com/gVX3yPJ.gif")
            await message.channel.send("????" + secondCaptain.mention, embed=embed)
1
Please edit your question to include the code in the body, not just as a link.Benjin
Hey i updated it. i hope this is enough :)bboychris168

1 Answers

0
votes

I saw your github code. You just store the id of the message sent last as a variable and before sending a new message. Delete the Previous Message.