From df3307f185cb8ae8a66351991ee965c5d4d1731e Mon Sep 17 00:00:00 2001 From: tropii <97747461+TropiiDev@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:34:40 -0500 Subject: [PATCH] Announce Updated! --- commands/announce.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/announce.py b/commands/announce.py index 2a332ff..55b2af5 100644 --- a/commands/announce.py +++ b/commands/announce.py @@ -46,7 +46,9 @@ class announce(commands.Cog): msg = await self.bot.wait_for("message", check=check, timeout=10) if msg.content == "delete": coll.delete_one({"_id": {"guild_id": ctx.guild.id}}) - await ctx.send("Announcement channel deleted") + await ctx.send("Announcement channel deleted, adding new channel...") + coll.insert_one({"_id": {"guild_id": ctx.guild.id}, "channel": channel.id}) + await ctx.send("Announcement channel set") except asyncio.TimeoutError: await ctx.send("You took too long to respond") return @@ -67,6 +69,7 @@ class announce(commands.Cog): channel_id = coll.find_one({"_id": {"guild_id": ctx.guild.id}})["channel"] channel = discord.utils.get(ctx.guild.text_channels, id=channel_id) await channel.send(message) + await ctx.send("Announcement sent!", delete_after=2.0) else: await ctx.send("You have not set an announcement channel yet")