General Updates
This commit is contained in:
parent
5d1200c33a
commit
54af5c5c08
4 changed files with 33 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -128,5 +128,6 @@ dmypy.json
|
|||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
Deployment/
|
||||
deepspeech-0.9.3-models.pbmm
|
||||
deepspeech-0.9.3-models.scorer
|
|
@ -42,7 +42,7 @@ class ApplicationModal(disnake.ui.Modal):
|
|||
applicationdenied = False
|
||||
application = inter.text_values.items()
|
||||
for key, value in application:
|
||||
if key == "The secret phrase" and value != os.getenv("PHRASE"):
|
||||
if key == "The secret phrase" and value.lower() != os.getenv("PHRASE"):
|
||||
applicationdenied = True
|
||||
embed_color = disnake.Colour.red()
|
||||
embed_title = "Auto-Denied Application"
|
||||
|
@ -133,6 +133,26 @@ async def apply(inter: disnake.AppCmdInter):
|
|||
disnake.ui.Button(label="Apply", style=disnake.ButtonStyle.success, custom_id="Apply"),
|
||||
])
|
||||
|
||||
@bot.slash_command(
|
||||
name="reapply",
|
||||
description="Allow a user to reapply to the server"
|
||||
)
|
||||
async def reapply(inter: disnake.AppCmdInter, reason:str, user:disnake.Member):
|
||||
await inter.response.defer()
|
||||
guild = bot.get_guild(int(os.getenv("GUILD_ID")))
|
||||
role = guild.get_role(int(os.getenv("APPLICANT_ROLE_ID")))
|
||||
dmuser = await bot.fetch_user(int(user.id))
|
||||
if role in user.roles:
|
||||
await user.remove_roles(role)
|
||||
try:
|
||||
await dmuser.send(f"you have been given a second chance to apply, because {reason}")
|
||||
await inter.response.edit_original_response("User Notified and application reopened!")
|
||||
except:
|
||||
await inter.response.edit_original_response("Failed to notify user, application reopened")
|
||||
else:
|
||||
await inter.response.edit_original_response("That user hasn't applied yet!")
|
||||
|
||||
|
||||
@bot.listen("on_button_click")
|
||||
async def button_listener(inter: disnake.MessageInteraction):
|
||||
if inter.component.custom_id == "Apply":
|
||||
|
@ -164,7 +184,7 @@ async def button_listener(inter: disnake.MessageInteraction):
|
|||
await user.send("You have been Whitelisted!")
|
||||
except:
|
||||
dmstat = ", Failed to DM user"
|
||||
status = "Aprroved and Whitelisted"
|
||||
status = "Approved and Whitelisted"
|
||||
embed.add_field(
|
||||
name="Status",
|
||||
value=f"{status}{dmstat}",
|
||||
|
|
7
dockerfile
Normal file
7
dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM python:3.11
|
||||
|
||||
WORKDIR /applicationbot
|
||||
|
||||
COPY . ./
|
||||
RUN pip install --timeout 10000 -r requirements.txt
|
||||
CMD [ "python", "./applicationbot.py"]
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
disnake == 2.9.1
|
||||
python-dotenv
|
||||
rcon
|
Loading…
Reference in a new issue