Skip to content

Commit

Permalink
🐛 fix owner check
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Apr 28, 2023
1 parent f325313 commit cb92fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions wopr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class BotBase(commands.Bot):
"""A base class for the bot to allow for custom attributes."""

start_time: datetime
owners: list[int]


logging.basicConfig(handlers=[InterceptHandler()], level=logging.INFO, force=True)
Expand All @@ -57,6 +58,9 @@ async def on_ready() -> None:
bot.tree.copy_global_to(guild=MY_GUILD)
await bot.tree.sync(guild=MY_GUILD)

for owner in await bot.application_info().team.members:
bot.owners.append(owner.id)


@bot.tree.command()
async def ping(interaction: discord.Interaction) -> None:
Expand Down
2 changes: 1 addition & 1 deletion wopr/exts/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, bot: commands.Bot):

async def interaction_check(self, interaction: discord.Interaction) -> bool:
"""Check if the user is an administrator."""
return interaction.user.id in self.bot.owner_ids
return interaction.user.id in self.bot.owners

@app_commands.command()
async def load(self, interaction: discord.Interaction, extension: str) -> None:
Expand Down

0 comments on commit cb92fe1

Please sign in to comment.