Skip to content

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimoschi committed Apr 24, 2024
1 parent a135e04 commit cf465de
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/cmds/core/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ def __init__(self, *args, **kwargs) -> None:
self.add_item(InputText(label="Feedback", style=discord.InputTextStyle.long))

async def callback(self, interaction: discord.Interaction):

await interaction.response.send_message("Thank you, your feedback has been recorded.")

webhook = WebhookClient(settings.slack_webhook)
webhook = WebhookClient(settings.SLACK_WEBHOOK)

response = webhook.send(
text=f"{self.children[0].value} - {self.children[1].value}",
blocks=[
Expand All @@ -40,6 +39,7 @@ async def callback(self, interaction: discord.Interaction):
assert response.status_code == 200
assert response.body == "ok"


class OtherCog(commands.Cog):
"""Ban related commands."""

Expand All @@ -48,7 +48,7 @@ def __init__(self, bot: Bot):

@slash_command(guild_ids=settings.guild_ids, description="A simple reply stating hints are not allowed.")
async def no_hints(
self, ctx: ApplicationContext
self, ctx: ApplicationContext
) -> Message:
"""A simple reply stating hints are not allowed."""
return await ctx.respond(
Expand All @@ -57,10 +57,11 @@ async def no_hints(
"After Party event."
)

@slash_command(guild_ids=settings.guild_ids, description="A simple reply proving a link to the support desk article on how to get support")
@slash_command(guild_ids=settings.guild_ids,
description="A simple reply proving a link to the support desk article on how to get support")
@commands.cooldown(1, 60, commands.BucketType.user)
async def support(
self, ctx: ApplicationContext
self, ctx: ApplicationContext
) -> Message:
"""A simple reply proving a link to the support desk article on how to get support"""
return await ctx.respond(
Expand All @@ -82,10 +83,11 @@ async def spoiler(self, ctx: ApplicationContext, url: str) -> Interaction | Webh

@slash_command(guild_ids=settings.guild_ids, description="Provide feedback to HTB!")
@commands.cooldown(1, 60, commands.BucketType.user)
async def feedback(self, ctx: ApplicationContext) -> Message:
async def feedback(self, ctx: ApplicationContext) -> Interaction:
""" Provide Feedback to HTB """
modal = FeedbackModal(title="Feedback") # Send the Modal defined above in Feedback Modal, which handles the callback
await ctx.send_modal(modal)
modal = FeedbackModal(
title="Feedback") # Send the Modal defined above in Feedback Modal, which handles the callback
return await ctx.send_modal(modal)


def setup(bot: Bot) -> None:
Expand Down

0 comments on commit cf465de

Please sign in to comment.