Updated meme and announce

This commit is contained in:
tropii 2023-11-24 17:18:28 -05:00
parent 1b110c3f41
commit 3e0609223b
4 changed files with 6 additions and 26 deletions

11
bot.py
View File

@ -66,17 +66,6 @@ class MyBot(commands.Bot):
async def on_ready(self): async def on_ready(self):
await self.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"over {len(self.guilds)} servers!")) 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 # making var for commands in this file
bot = MyBot() bot = MyBot()

View File

@ -65,21 +65,9 @@ class announce(commands.Cog):
db = client.servers db = client.servers
coll = db.announce 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}}): if coll.find_one({"_id": {"guild_id": ctx.guild.id}}):
channel = coll.find_one({"_id": {"guild_id": ctx.guild.id}, "channel": ctx.channel.id}) channel = coll.find_one({"_id": {"guild_id": ctx.guild.id}})["channel"]
if channel == False: await channel.send(message)
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)
else: else:
await ctx.send("You have not set an announcement channel yet") await ctx.send("You have not set an announcement channel yet")

View File

@ -15,7 +15,7 @@ class Select(discord.ui.Select):
async def callback(self, interaction: discord.Interaction): async def callback(self, interaction: discord.Interaction):
if self.values[0] == "Staff Commands": if self.values[0] == "Staff Commands":
em = discord.Embed(title="Staff Commands", description="Here are all the staff commands", color=interaction.user.color) 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="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="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) em.add_field(name="ban", value="Ban a member from the server, Example: -ban @Tropiiツ", inline=False)

View File

@ -41,6 +41,9 @@ class meme(commands.Cog):
async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response: async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response:
response = requests.request("GET", url, headers=headers) 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()) await ctx.send(response.json())
async def setup(bot): async def setup(bot):