#๐ Why the slash command disappears after i do an error to the command
52 messages ยท Page 1 of 1 (latest)
@golden hinge
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.
are other slash commands present?
No
also not working
if i add error
just then
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.
```py
```
oof
code block ๐
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```
please use this instead
have you synced your commands?
no
pycord?
yea
how you are doing it
it doesnt need to sync in py-cord r ight?
ok
use logging?
oh
still not working
i put there the self
u can see
@brazen heart
still not work
change the function name to not conflict with ticket_panel?
the error handler has the same name as the original
thank you man
i got it now
its working
i love u
!close
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.