Improved information display mode

This commit is contained in:
Matias Espinoza
2023-03-20 19:02:00 -03:00
parent 54417cfb0f
commit 58e9b0c646
3 changed files with 48 additions and 24 deletions

View File

@ -11,13 +11,13 @@ export const ClearCommand: Command = {
/**
* Get the chat history from the channel and filter the messages from the user
*/
const channel = client.channels.cache.get(interaction.channelId) as TextChannel;
const channel = client.channels.cache.get(interaction.channelId) as TextChannel; // Get the channel from the channel id
const messages = await channel.messages.fetch({ limit: 100 }); // Get the last 100 messages from the channel
const consistentMessages = messages
.filter((x) => x.interaction?.user.id === interaction.user.id);
/**
* Delete the messages from the channel
* Check if the channel is a guild text channel or a DM channel
*/
if (channel.type === ChannelType.GuildText) {
/**