fix: Refactor owner ID usage in TerminalCog for consistency and clarity
This commit is contained in:
parent
a6b1f6a1b3
commit
22a278f748
@ -23,12 +23,11 @@ ERROR_COLOR = (255, 100, 100) # Reddish
|
||||
MAX_HISTORY_LINES = 500 # Max lines to keep in history
|
||||
AUTO_UPDATE_INTERVAL_SECONDS = 3
|
||||
MAX_OUTPUT_LINES_PER_IMAGE = (IMG_HEIGHT - 2 * PADDING) // (FONT_SIZE + LINE_SPACING)
|
||||
|
||||
OWNER_ID = 452666956353503252
|
||||
|
||||
# --- Helper: Owner Check ---
|
||||
async def is_owner_check(interaction: discord.Interaction) -> bool:
|
||||
"""Checks if the interacting user is the hardcoded bot owner."""
|
||||
OWNER_ID = 452666956353503252 # Replace with your Discord user ID
|
||||
return interaction.user.id == OWNER_ID
|
||||
|
||||
|
||||
@ -436,7 +435,7 @@ class TerminalView(ui.View):
|
||||
async def interaction_check(self, interaction: Interaction) -> bool:
|
||||
"""Ensure only the bot owner can interact."""
|
||||
# Use the cog's owner_id which should be set correctly
|
||||
is_allowed = interaction.user.id == self.cog.owner_id
|
||||
is_allowed = interaction.user.id == OWNER_ID
|
||||
if not is_allowed:
|
||||
await interaction.response.send_message("You are not authorized to use these buttons.", ephemeral=True)
|
||||
return is_allowed
|
||||
|
Loading…
x
Reference in New Issue
Block a user