I'm trying to add a modal but discord just says "Unknown integration" when I run the command.
Command:
...
from . import modals
@bot.slash_command(name="link", description="Links a Roblox place to this server.")
async def link(ctx):
await ctx.send_modal(modals.RegisterModal())
Modals.py file:
import discord
from discord import ui
class RegisterModal(ui.Modal):
def __init__(self):
super().__init__(title="Link Game")
self.place = ui.InputText(
label="Place ID",
placeholder="Use `print(game.PlaceId)` to find it",
max_length=25,
required=True
)
self.token = ui.InputText(
label="Access Token",
placeholder="xxxxxxxxxx",
style=discord.TextStyle.short,
required=True
)
self.add_item(self.place)
self.add_item(self.token)
async def callback(self, interaction: discord.Interaction):
place_id = self.place.value
token = self.token.value
print(f"register: {place_id} {token}")
await interaction.response.send_message(
f"place: {place_id}, token: {token}",
ephemeral=True
)