I'm trying to make a discord bot that sends a message in a specific channel for telling users when my Minecraft server is on or off. I just need to send 2 embeds one for starting and another for turning off like this:
I'm trying to delete the old messages the bot has sent but I don't know how.
import discord
import sys
import os
from datetime import datetime
now = datetime.now()
Ntime = now.strftime("%H:%M:%S")
txtStart = ()
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
channel = client.get_channel(800317242910834699)
embed= discord.Embed(title="[ Server Status ]", description="Running...", color=discord.Color.green())
embed.add_field(name="success At :", value=Ntime, inline=True)
file = discord.File(os.path.join("D:\Scripts\Discord/ServerStarted.gif"), filename="ServerStarted.gif")
embed.set_thumbnail(url="attachment://ServerStarted.gif")
message = await channel.send(file=file, embed=embed)
embed= discord.Embed(title="[ Server Status ]", description="shutting down...", color=discord.Color.red())
embed.add_field(name="success At :", value=Ntime, inline=True)
file = discord.File(os.path.join("D:\Scripts\Discord/ServerStoped.gif"), filename="ServerStoped.gif")
embed.set_thumbnail(url="attachment://ServerStoped.gif")
await channel.send(file=file, embed=embed)