#๐Ÿ”’ Why the slash command disappears after i do an error to the command

52 messages ยท Page 1 of 1 (latest)

golden hinge
#

Why the slash command disappears after i do an error to the command

dusky cipherBOT
#

@golden hinge

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

brazen heart
#

are other slash commands present?

golden hinge
#

also not working

#

if i add error

#

just then

brazen heart
#

show ur whole command

#

!paste

dusky cipherBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

frail gazelle
#

```py
```

golden hinge
#

oof

frail gazelle
#

code block ๐Ÿ˜…

golden hinge
#

sec

#
    @has_permissions(administrator=True)
    async def ticket_panel(self, interaction: discord.Interaction):
        self.channel = self.bot.get_channel(TICKET_CHANNEL)
        embed = discord.Embed(title="Stellar Services Ticket", description=f"> If you need any assistance click on the button corresponding to the type of ticket you wish to open.\n> Before you open ticket, read the TOS and the FAQ.", color=0xFA6522, timestamp=datetime.datetime.now())
        embed.set_image(url=f"https://media.discordapp.net/attachments/1138145892680081488/1170089358985003069/image_2.png?ex=6557c5a2&is=654550a2&hm=5c045046f2a7a5e6a602689080ea7dd661aad7bb66020980673861fd7370280e&=&width=702&height=145")
        embed.set_footer(text="Stellar Services Ticket, Developer: onlyontop", icon_url="https://media.discordapp.net/attachments/1138145892680081488/1170086536914677790/image_1.png?width=512&height=486")
        await self.channel.send(embed=embed, view=MyView(self.bot))

        ticket_panel_success = discord.Embed(title=f"Success", description=f'Ticket Panel successfully sended to the ticket channel!', color=0x57F288, timestamp=datetime.datetime.now())
        ticket_panel_success.set_footer(text=f"Requested by: {interaction.user.name}#{interaction.user.discriminator}", icon_url=interaction.user.display_avatar)
        await interaction.response.send_message(embed=ticket_panel_success, ephemeral=True)```
#
    async def ticket_panel(interaction: discord.Interaction, error):
        if isinstance(error, MissingPermissions):
            err=discord.Embed(title="INFO", description=f"You not have permission to do this.", color=0x034BAA, timestamp=datetime.datetime.now())
            await interaction.response.send_message(embed=err, ephemeral=True)
        else:
            err=discord.Embed(title="INFO", description=f"Something went wrong", color=0x034BAA, timestamp=datetime.datetime.now())
            await interaction.response.send_message(embed=err, ephemeral=True)
            raise error```
brazen heart
golden hinge
brazen heart
#

have you synced your commands?

golden hinge
#

no

frail gazelle
#

pycord?

golden hinge
#

yea

brazen heart
#

how you are doing it

frail gazelle
#

it doesnt need to sync in py-cord r ight?

golden hinge
#

yea

#

i dont need to

#

sync

#

its working without it

brazen heart
#

ok

golden hinge
#

in other commands

#

but if i add a error thing

#

its gonna disappear

frail gazelle
#

use logging?

brazen heart
#

self is missing in your error handler

#

that could be the reason

frail gazelle
#

oh

golden hinge
#

still not working

#

i put there the self

#

u can see

#

@brazen heart

#

still not work

brazen heart
#

change the function name to not conflict with ticket_panel?

brazen heart
#

the error handler has the same name as the original

golden hinge
#

i got it now

#

its working

#

i love u

#

!close

dusky cipherBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.