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

5
bot.py
View File

@ -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.")