added two pesky lines to actually add the role
parent
53ca312fd9
commit
8eb0ac2eac
3
bot.py
3
bot.py
|
@ -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.")
|
||||||
|
|
Loading…
Reference in New Issue