Updated meme and announce
This commit is contained in:
parent
1b110c3f41
commit
3e0609223b
11
bot.py
11
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()
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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)
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user