Pycord-Development / pycord

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
https://docs.pycord.dev
MIT License
2.74k stars 462 forks source link

Slash Command Shows Interaction Failed Message Even After Responding #1651

Closed wa1ker38552 closed 2 years ago

wa1ker38552 commented 2 years ago

Summary

The application shows a 'did not respond' message even after it has already responded.

Reproduction Steps

Create and send a command

Minimal Reproducible Code

import discord

# functions
def create_embed(em):
  embed = discord.Embed()
  embed.title = em['title']
  embed.color = em['color']
  embed.description = em['description']

  return embed

client = discord.Bot()

@client.event
async def on_ready():
  print(client.user)

@client.command(description='Show debug information')
async def debug(ctx):
  embed = create_embed({
    'title': 'Debug',
    'color': 0x338CFF,
    'description': f'**Latency: **`{round(client.latency, 3)}` ms'
  })
  await ctx.send(embed=embed)

client.run('TOKEN')

Expected Results

The application returns a response

Actual Results

The application returned a response but also showed an error message. As you can see, the application responded twice. image

Intents

discord.Intents.default()

System Information

I don't know why it says 10, i'm using 11. Running on pycharm.

Checklist

Additional Context

No response

JustaSqu1d commented 2 years ago

To respond to an interaction, you should use ctx.respond.

wa1ker38552 commented 2 years ago

Thank you, I could not find documentation for that when I searched the question.