#`50240: You cannot remove this app's Entry Point (...)` when trying to launch (commands not synced)

1 messages · Page 1 of 1 (latest)

crystal tusk
#

steps to reproduce:

  1. create app thing
  2. make a bot
  3. launch code with command /a
  4. enable activities and modify code to add command /b
  5. relaunch code

reading old posts about it here, it seems it's caused by enabling activities, and the usual solution is to disable activities; is there a way to update commands without disabling activities? (e.g. set the entry point command in the code?)

(commands were made with the discord.Bot()'s @bot.slash_command format)

low brook
#

I will take a look asap

crystal tusk
#

ty!

crystal tusk
#

help ticket leading to discussion in library development .. big leagues

low brook
#

Haah

glad bloom
#

Hey @crystal tusk! I just created a branch with a way for you to fix your problem. If you have any suggestions or find anything wrong let me know. At this time I cant really predict when this will make it into the main library. I forgot to mention earlier that you could also immediately solve your problem by setting auto_sync=False in your bot constructor. This would mean that you need to either sync your command manually or individually within py-cord if you make changes to their definitions.

pip install git+https://github.com/Pycord-Development/pycord.git@feat/activity-interactions
https://github.com/Pycord-Development/pycord/tree/feat/activity-interactions
You can create an entry point command in the same way that you would create other types of commands.

@bot.entry_point_command(normal_app_command_kwargs, handler=discord.EntryPointHandler.app_handler)
async def launch(ctx: ApplicationContext):
    ...

Some things to note, if you already have a custom entry point command registered you will have to match its structure here. This includes the one that discord makes by default. You will lose all of the name/description localizations if you dont specify them manually. Also there is a entry point command specific attribute called handler as shown above. There are 2 values that you can read about here if needed. It should be noted that DISCORD_LAUNCH_ACTIVITY handlers does not make an interaction, so despite having a callback function it will not be called. I also added ctx.response.launch_activity() is that is useful you.
CC @low brook if you have any feedback on my design

low brook
#

Will look at it tomorrow, thx breadlove

crystal tusk
glad bloom
#

I'm not sure how far you got making the entry point command before. You would have to replicate any work that you have done. By default discord makes a command for you when you enable activities. This command has name and description localizations (shows in different languages depending on the users discord language settings). If you want to keep these localizations you would have to specify them manually like you would for a normal slash command, otherwise they will be cleared (but you can always add them back).

I also just realized that if your entry point command has a name that is different then launch it might not work. I will have to test later and fix if needed

crystal tusk
#

managed to make it work with:

@bot.entry_point_command(handler=2, name="launch", description="Launch NotGeki")
async def launch(ctx: discord.ApplicationContext):
    await ctx.response.launch_activity()

doesnt show up as a /command (intended) and appears in the activities box (and updates old commands)

#

ty!!!!

#

i think ill close it now since it works (and could possibly help other people 👀 )