From 8eb0ac2eacca3b4bc795922363bda03f8602024e Mon Sep 17 00:00:00 2001 From: Anorak_1 Date: Fri, 14 Jul 2023 22:57:01 +0200 Subject: [PATCH] added two pesky lines to actually add the role --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index a25e59d..a6da707 100644 --- a/bot.py +++ b/bot.py @@ -6,6 +6,7 @@ import json import sqlite3 from dotenv import load_dotenv from discord.ui import Modal, InputText +from discord.utils import get load_dotenv() @@ -36,7 +37,7 @@ async def on_ready(): @bot.slash_command(description = "Command used to apply", guild_ids = [866630736445702184]) async def apply(ctx): message = ctx.message - + await ctx.response.send_message(content="Application started", ephemeral=True) user = await ctx.author.create_dm() @@ -140,6 +141,8 @@ class ApplicationModal(discord.ui.Modal): await user.send(f"You have been accepted to the CreatTopia Minecraft server!") await user.send(f"Reason: {reason}") await interaction.response.send_message(content="Application accepted", ephemeral=True) + role = get(interaction.message.guild.roles, name="CreatTopian") + await discord.utils.get(interaction.message.guild.members, id=int(user_id)).add_roles(role) if self.action == "dec": user = await bot.get_user(user_id).create_dm() await user.send(f"You have been declined access to the CreatTopia Minecraft server.")