Skip to content

added update-staff-list, nuke, changed welcome banner #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions cogs/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,43 @@ async def _beerparty(
await ctx.send(
", ".join(user.display_name for user in users) + " joined the beerparty!"
)

@commands.command(
name = 'nuke',
help = 'find out yourself'
)
@commands.cooldown(2, 10, commands.BucketType.guild)
async def _nuke(self, ctx: commands.Context):
msg = await ctx.reply("Nuking the server in 5 seconds!")
await asyncio.sleep(5)
await msg.edit(content="Nuke engaged :smiling_imp:")
await asyncio.sleep(random.randint(1,3))
reason = random.choice(
[
"Swas pooped in his pants",
"umm, I pressed the wrong button",
"I lost the nuke button",
"Arthex is gay",
"Conch prevented it",
"Lex is so hot",
"bcs yes!",
"I lost the launch codes",
"dinner is ready",
"it's bed time",
"you're not cool enough",
"my mumma said so",
"you really thought it would work",
"my dog ate my nuke",
"my boyfriend decided to call FBI",
"I am too lazy", # someone please add more funny phrases
]
)
embed = self.bot.embed(
title="Nuke Failed!",
description=f"Reason: {reason}",
color = 0xff0000
)
await msg.edit(content=None, embed=embed)

async def setup(bot: CodingBot):
await bot.add_cog(Fun(bot))
37 changes: 37 additions & 0 deletions cogs/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,43 @@ async def avatar_display(
text=f"Requested by {ctx.author}", icon_url=ctx.author.display_avatar.url
)
await self.bot.reply(ctx, embed=embed)


@commands.command(name='update-staff-list')
@commands.has_permissions(administrator=True)
async def update_staff_list(self, ctx):
staff_list_channel = self.bot.get_channel(765066298299383809)
mod_roles = [
681895373454835749,
838634262693412875,
725899526350831616,
795136568805294097,
729530191109554237,
681895900070543411,
729537643951554583,
]
embed = discord.Embed(title='**Staff List**', color=0x2F3136)
embed.description = ''
for r in mod_roles:
r = ctx.guild.get_role(r)
valid_members = []
for m in r.members:
admin = m.top_role.name == 'Admin Perms' and r.name == 'Admin'
if m.top_role == r or admin:
valid_members.append(m)

embed.description += f"{r.mention} | **{len(valid_members)}** \n"

for m in valid_members:
embed.description += f"> `{m.id}` {m.mention}\n"
embed.description += '\n'
await staff_list_channel.purge(limit=1)
await staff_list_channel.send(embed=embed)
embed = self.bot.embed(
description = "Done ✅",
color=0x00ff00
)
await self.bot.send(ctx, embed = embed)


async def setup(bot: CodingBot) -> None:
Expand Down
14 changes: 8 additions & 6 deletions ext/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,14 @@ async def construct_image(self, **kwargs: Any) -> discord.File:
img = BytesIO(
await member.display_avatar.with_format("png").with_size(128).read()
)
try:
banner = BytesIO(
await member.guild.banner.with_format("png").with_size(512).read()
)
except AttributeError:
banner = "./storage/banner.png"
# try:
# banner = BytesIO(
# await member.guild.banner.with_format("png").with_size(512).read()
# )
# except AttributeError:
# banner = "./storage/banner.png"

banner = "./storage/banner.png"

return await self.generate_image(
member,
Expand Down
1 change: 0 additions & 1 deletion ext/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ def __init__(self) -> None:
690420846774321221, # BobDotCom
579041484796461076, # Conch.py
687882857171255309, # Lexionas74
462067035556282378, # gxpy no remove
]

async def setup_hook(self) -> None:
Expand Down
Binary file modified storage/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.