Announce Updated!
This commit is contained in:
parent
499b5fbce8
commit
df3307f185
@ -46,7 +46,9 @@ class announce(commands.Cog):
|
|||||||
msg = await self.bot.wait_for("message", check=check, timeout=10)
|
msg = await self.bot.wait_for("message", check=check, timeout=10)
|
||||||
if msg.content == "delete":
|
if msg.content == "delete":
|
||||||
coll.delete_one({"_id": {"guild_id": ctx.guild.id}})
|
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:
|
except asyncio.TimeoutError:
|
||||||
await ctx.send("You took too long to respond")
|
await ctx.send("You took too long to respond")
|
||||||
return
|
return
|
||||||
@ -67,6 +69,7 @@ class announce(commands.Cog):
|
|||||||
channel_id = coll.find_one({"_id": {"guild_id": ctx.guild.id}})["channel"]
|
channel_id = coll.find_one({"_id": {"guild_id": ctx.guild.id}})["channel"]
|
||||||
channel = discord.utils.get(ctx.guild.text_channels, id=channel_id)
|
channel = discord.utils.get(ctx.guild.text_channels, id=channel_id)
|
||||||
await channel.send(message)
|
await channel.send(message)
|
||||||
|
await ctx.send("Announcement sent!", delete_after=2.0)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await ctx.send("You have not set an announcement channel yet")
|
await ctx.send("You have not set an announcement channel yet")
|
||||||
|
Loading…
Reference in New Issue
Block a user