Skip to content

Commit

Permalink
bruh (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewj-brown authored Nov 8, 2023
1 parent 86b238b commit c304268
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions uqcsbot/manage_cogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
from discord.ext import commands

from uqcsbot.yelling import yelling_exemptor
from uqcsbot.bot import UQCSBot


class ManageCogs(commands.Cog):
"""
Note that most of these commands can make the bot load files to execute. Care should be made to ensure only entrusted users have access.
"""

def __init__(self, bot: commands.Bot):
def __init__(self, bot: UQCSBot):
self.bot = bot

@app_commands.command(name="managecogs")
@app_commands.default_permissions(manage_guild=True)
@app_commands.checks.has_permissions(manage_guild=True)
@app_commands.describe(
cog='The cog (i.e. python file) to try to unload. Use python package notation, so no suffix of ".py" and "." between folders: e.g. "manage_cogs".',
)
Expand Down Expand Up @@ -49,5 +50,5 @@ async def manage_cogs(
await self.bot.tree.sync()


async def setup(bot: commands.Bot):
async def setup(bot: UQCSBot):
await bot.add_cog(ManageCogs(bot))
7 changes: 3 additions & 4 deletions uqcsbot/starboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ async def on_ready(self):
)

@app_commands.command()
@app_commands.default_permissions(manage_guild=True)
@app_commands.checks.has_permissions(manage_guild=True)
async def cleanup_starboard(self, interaction: discord.Interaction):
"""Cleans up the last 100 messages from the starboard.
Removes any uqcsbot message that doesn't have a corresponding message id in the db, regardless of recv.
Otherwise, causes a starboard update on the messages.
manage_guild perms: for committee and infra use.
"""

if interaction.channel == self.starboard_channel:
# because if you do it from in the starboard, it deletes its own interaction response
# and i cba making it not do that, so i'll just forbid doing it in starboard.
Expand Down Expand Up @@ -146,7 +145,7 @@ async def _blacklist_log(
)
)

@app_commands.default_permissions(manage_messages=True)
@app_commands.checks.has_permissions(manage_messages=True)
async def context_blacklist_sb_message(
self, interaction: discord.Interaction, message: discord.Message
):
Expand Down Expand Up @@ -194,7 +193,7 @@ async def context_blacklist_sb_message(
f"Blacklisted message {message.id}.", ephemeral=True
)

@app_commands.default_permissions(manage_messages=True)
@app_commands.checks.has_permissions(manage_messages=True)
async def context_unblacklist_sb_message(
self, interaction: discord.Interaction, message: discord.Message
):
Expand Down

0 comments on commit c304268

Please sign in to comment.