fix(suggestions): changed some indentation
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-21 11:23:11 -04:00
parent ae96e7d08d
commit 9568fb548e
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -598,52 +598,52 @@ class Suggestions(commands.Cog):
True True
) )
class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."): class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."):
def __init__(self, cog_instance, message): def __init__(self, cog_instance, message):
super().__init__() super().__init__()
self.cog_instance = cog_instance self.cog_instance = cog_instance
self.message = message self.message = message
reason = discord.ui.TextInput( reason = discord.ui.TextInput(
label="Approval Reason", label="Approval Reason",
placeholder="Why are you approving this suggestion?", placeholder="Why are you approving this suggestion?",
style=discord.TextStyle.paragraph, style=discord.TextStyle.paragraph,
required=False, required=False,
max_length=1024 max_length=1024
) )
async def on_submit(self, interaction: discord.Interaction): async def on_submit(self, interaction: discord.Interaction):
if self.reason.value != "": if self.reason.value != "":
await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, self.reason.value) await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, self.reason.value)
else: else:
await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, None) await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, None)
await interaction.response.send_message(content="Suggestion approved!", ephemeral=True) await interaction.response.send_message(content="Suggestion approved!", ephemeral=True)
class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
def __init__(self, cog_instance, message): def __init__(self, cog_instance, message):
super().__init__() super().__init__()
self.cog_instance = cog_instance self.cog_instance = cog_instance
self.message = message self.message = message
reason = discord.ui.TextInput( reason = discord.ui.TextInput(
label="Denial Reason", label="Denial Reason",
placeholder="Why are you denying this suggestion?", placeholder="Why are you denying this suggestion?",
style=discord.TextStyle.paragraph, style=discord.TextStyle.paragraph,
required=False, required=False,
max_length=1024 max_length=1024
) )
async def on_submit(self, interaction: discord.Interaction): async def on_submit(self, interaction: discord.Interaction):
if self.reason.value != "": if self.reason.value != "":
await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, self.reason.value) await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, self.reason.value)
else: else:
await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, None) await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, None)
await interaction.response.send_message(content="Suggestion denied!", ephemeral=True) await interaction.response.send_message(content="Suggestion denied!", ephemeral=True)
@app_commands.context_menu(name="Approve Suggestion") @app_commands.context_menu(name="Approve Suggestion")
async def approve_context(interaction: discord.Interaction, message: discord.Message): async def approve_context(interaction: discord.Interaction, message: discord.Message):
await interaction.response.send_modal(Suggestions.SuggestionApproveModal(Suggestions, message)) await interaction.response.send_modal(SuggestionApproveModal(Suggestions, message))
@app_commands.context_menu(name="Deny Suggestion") @app_commands.context_menu(name="Deny Suggestion")
async def deny_context(interaction: discord.Interaction, message: discord.Message): async def deny_context(interaction: discord.Interaction, message: discord.Message):
await interaction.response.send_modal(Suggestions.SuggestionDenyModal(Suggestions, message)) await interaction.response.send_modal(SuggestionDenyModal(Suggestions, message))