Skip to content

Conversation

Egemenbdk
Copy link

@Egemenbdk Egemenbdk commented Aug 14, 2025

If a slash command directly returns a modal, for example: interaction.response.send_modal(), the slash command will get logged as a deleted message even though no message was sent and since its contentless, it overlaps with other elements shown below and doesn't appear right, this 4 line update will stop logging contentless messages which are only possible if a slash command returns a modal.

image

edit: fixed my grammar its 5 am

Comment on lines 262 to 265
if (!msg.content || msg.content.trim() === "") {
cache = cache.remove(id);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this? Messages without content but have embeds, attachments, components (esp CV2), polls, message snapshots, nested interaction data or any other future field will be ignored because content will be empty.

There must be a better way you can handle this.

Copy link
Author

@Egemenbdk Egemenbdk Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a check to make sure it was a slash command that directly returned a modal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if message.state is SENDING on these modal spawns and if it is check if its a bot or from an interaction, if it does then you should be able to reliably go off that.

Hardcoding this is not future proof at all and should be avoided, especially over something so minor.

@Egemenbdk Egemenbdk changed the title fix contentless messages dont get logged fix empty messages dont get logged (modal interaction responses) Aug 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants