#Unknown Integration error on modal

1 messages · Page 1 of 1 (latest)

sonic lodge
#

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
        )

#

nothing unordinary in the logs

civic sail
sonic lodge
#

oh damn thanks

sonic lodge
#

do you know why i can't fire it more than oncd

#

it seems to fully de-register the command if i trigger it

waxen fiber
#

Do you have multiple instances of your bot running?

sonic lodge
#

oh i might

#

let me check the lxc

#

it's still online for some reason after i commented out the line triggering it from a node so i'll just rotate the token

#

yep that was it thx

waxen fiber
#

To explain what was likely happening. You had 2 versions of the code with different sets of commands. When you used the command one code responded and the other code was like "I dont know this command exists". So that code removes the command because it thought that it should not exist.

sonic lodge
#

yyeah that checks out