Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction has already been acknowledged when messages fetching is called #419

Open
oliverhuynh opened this issue Feb 24, 2025 · 0 comments

Comments

@oliverhuynh
Copy link

/src/commands/clear.ts

import { createCommandConfig, logger } from 'robo.js'                                   
import type { ChatInputCommandInteraction } from 'discord.js'                           
                                                                                        
export const config = createCommandConfig({                                             
  description: `Clear user's chats`
} as const)                                                                             
                                                                                        
/**                                                                                     
 * Clear all tested messages                                                            
 */                                                                                     
export default async (interaction: ChatInputCommandInteraction) => {            
  const channel = await interaction.channel                                             
  const messages = await channel.messages
  // @TODO Bug This would cause Interaction has already been acknowledged when the following line is uncommented 
  // const userMessages = await messages.fetch()
  
  interaction.reply(`${interaction.user} has cleared the messages`)
} 

Can someone give me a shine on this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant