From 3e0609223bf0760095e15db22c46913fa1f0b1b4 Mon Sep 17 00:00:00 2001 From: tropii <97747461+TropiiDev@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:18:28 -0500 Subject: [PATCH] Updated meme and announce --- bot.py | 11 ----------- commands/announce.py | 16 ++-------------- commands/help.py | 2 +- commands/meme.py | 3 +++ 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/bot.py b/bot.py index 535ca44..097408d 100644 --- a/bot.py +++ b/bot.py @@ -66,17 +66,6 @@ class MyBot(commands.Bot): async def on_ready(self): await self.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"over {len(self.guilds)} servers!")) - for guild in self.guilds: - try: - channel = discord.utils.get(guild.text_channels, name="general") - - if channel: - em = discord.Embed(title="Official Message", description=f"**An official message from Tropii (Owner and Developer of Blob).**\n\nWe are restarting Blob and bringing him back to life! We are also open to adding new features and other things.\n\nPlease join the new support server for more information!\n\n**[Join the Support Server](https://discord.gg/kuYNHR6Rrx)**", color=discord.Color.green()) - - await channel.send(embed=em) - except: - pass - # making var for commands in this file bot = MyBot() diff --git a/commands/announce.py b/commands/announce.py index afb6300..1ee8ea4 100644 --- a/commands/announce.py +++ b/commands/announce.py @@ -65,21 +65,9 @@ class announce(commands.Cog): db = client.servers coll = db.announce - ak = coll.find_one({"_id": {"guild_id": ctx.guild.id}}) - - await ctx.send(ak) - - if coll.find_one({"_id": {"guild_id": ctx.guild.id}}): - channel = coll.find_one({"_id": {"guild_id": ctx.guild.id}, "channel": ctx.channel.id}) - if channel == False: - await ctx.send("You can only use this command in the announcement channel") - return - else: - newchannel = channel['channel'] - channelll = self.bot.get_channel(newchannel) - await channelll.send(message) - await ctx.send("Announcement sent", delete_after=2) + channel = coll.find_one({"_id": {"guild_id": ctx.guild.id}})["channel"] + await channel.send(message) else: await ctx.send("You have not set an announcement channel yet") diff --git a/commands/help.py b/commands/help.py index 9b34a90..bfff12b 100644 --- a/commands/help.py +++ b/commands/help.py @@ -15,7 +15,7 @@ class Select(discord.ui.Select): async def callback(self, interaction: discord.Interaction): if self.values[0] == "Staff Commands": em = discord.Embed(title="Staff Commands", description="Here are all the staff commands", color=interaction.user.color) - em.add_field(name="announce", value="Announce a message in the Announcements channel (Can only be used in the official PL server), Example: -announce Announcing a message", inline=False) + em.add_field(name="announce", value="Announce a message in the Announcements channel, Example: -announce Announcing a message", inline=False) em.add_field(name="clear", value="Bulk deletes messages, Example: -clear 5", inline=False) em.add_field(name="kick", value="Kicks a member from the server, Example: -kick @Tropiiツ", inline=False) em.add_field(name="ban", value="Ban a member from the server, Example: -ban @Tropiiツ", inline=False) diff --git a/commands/meme.py b/commands/meme.py index 9a42bac..2e03bb9 100644 --- a/commands/meme.py +++ b/commands/meme.py @@ -41,6 +41,9 @@ class meme(commands.Cog): async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response: response = requests.request("GET", url, headers=headers) + embed = discord.Embed(title=response.json()['title'], color=discord.Color.random()) + await ctx.send(embed=embed) + await ctx.send(response.json()) async def setup(bot):