Skip to content

Commit

Permalink
Merge pull request #55 from jensengillett/development
Browse files Browse the repository at this point in the history
Development to main
  • Loading branch information
jensengillett authored Aug 31, 2023
2 parents dc5efc7 + 7e3027d commit e0fa0e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions cogs/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ async def _email(self, ctx, arg):
print(f"Alert! Bot has encountered an exception. Traceback: {e}")
return

await ctx.send(f"Verification email sent to {ctx.author.mention}, please use `{self.bot_key}verify ####`, where `####` is the token, to verify.")
await ctx.send(f"Verification email sent to {ctx.author.mention}, please use `{self.bot_key}verify ####`, where `####` is the token, to verify.\n"
f"If you can't find the email, please check your 'Junk Email' folder before contacting the moderation team.")

if self.email_attempts:
if ctx.author.id in self.email_attempts:
Expand Down Expand Up @@ -233,8 +234,6 @@ async def _verify(self, ctx, arg):
# Do the actual verification.
if self.token_list:
if self.token_list[ctx.author.id] == arg:
await ctx.send(f"{ctx.author.mention}, you've been verified!")

role = discord.utils.get(ctx.guild.roles, name=self.role)
if not role:
role = discord.utils.find(lambda r: str(r.id) == str(self.role), ctx.guild.roles)
Expand All @@ -244,6 +243,9 @@ async def _verify(self, ctx, arg):
hashed = self.bot.hashing.hash(self.email_list[ctx.author.id])
file.write(f"{hashed}\n")
file.close()

self.token_list.pop(ctx.author.id) # Remove the token from the active list.
await ctx.send(f"{ctx.author.mention}, you've been verified!")
else:
await ctx.send(f"Invalid token submitted, {ctx.author.mention}! Please submit the 4-digit token send to your email to verify.")
if self.verify_attempts:
Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: "3"
version: "3.1"
services:
dockerbot:
image: kaosjr/verificationbot:latest
verificationbot:
build:
context: ./
dockerfile: Dockerfile
environment:
# The Discord bot token being used. Do not share this!
- token=
Expand Down

0 comments on commit e0fa0e0

Please sign in to comment.