added two pesky lines to actually add the role

main
Anorak_1 2023-07-14 22:57:01 +02:00
parent 53ca312fd9
commit 8eb0ac2eac
1 changed files with 4 additions and 1 deletions

3
bot.py
View File

@ -6,6 +6,7 @@ import json
import sqlite3 import sqlite3
from dotenv import load_dotenv from dotenv import load_dotenv
from discord.ui import Modal, InputText from discord.ui import Modal, InputText
from discord.utils import get
load_dotenv() load_dotenv()
@ -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"You have been accepted to the CreatTopia Minecraft server!")
await user.send(f"Reason: {reason}") await user.send(f"Reason: {reason}")
await interaction.response.send_message(content="Application accepted", ephemeral=True) 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": if self.action == "dec":
user = await bot.get_user(user_id).create_dm() user = await bot.get_user(user_id).create_dm()
await user.send(f"You have been declined access to the CreatTopia Minecraft server.") await user.send(f"You have been declined access to the CreatTopia Minecraft server.")