Skip to content

Commit

Permalink
fix docker compose
Browse files Browse the repository at this point in the history
add support for cancelling a pending verification using /unverify
  • Loading branch information
emberdex committed Oct 5, 2023
1 parent ecf59d1 commit f930189
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ services:
- type: bind
source: ./config.json
target: /botapp/config.json
networks:
- harmony

mongodb:
image: "mongo:7.0.2"
command: --replSet rs01 --bind_ip localhost,harmony-db
container_name: "harmony-db"
ports:
- "127.0.0.1:27020:27017"
env_file:
- .env.mongodb
networks:
- harmony
volumes:
- type: bind
source: ./db
target: /data/db

networks:
harmony:
6 changes: 6 additions & 0 deletions harmony_cogs/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class UnverifyConfirmationModal(discord.ui.Modal, title="Enter your Reddit usern

async def unverify(self, interaction: discord.Interaction):
verification_data = harmony_db.get_verification_data(interaction.user.id)

reddit_username = self.reddit_username_field.value

reddit_username = reddit_username.replace('u/', '')
Expand Down Expand Up @@ -228,6 +229,11 @@ async def display_verification_dialog(self, interaction: discord.Interaction) ->
async def display_unverify_dialog(self, interaction: discord.Interaction):
if harmony_db.has_verification_data(interaction.user.id):
await interaction.response.send_modal(UnverifyConfirmationModal())
elif harmony_db.has_pending_verification(interaction.user.id):
pending_verification = harmony_db.get_pending_verification(interaction.user.id)
pending_verification.delete()
await interaction.response.send_message(
"Your pending verification has been cancelled. You can `/verify` again at any time.", ephemeral=True)
else:
await interaction.response.send_message("Doesn't look like you're verified.", ephemeral=True)

Expand Down

0 comments on commit f930189

Please sign in to comment.