Skip to content

delete blacklisted attachments from message and replace with webhook - #520

Merged
danthe1st merged 4 commits into
Java-Discord:mainfrom
ayyhimself:ayys-crazy-attachment-remover
Aug 24, 2025
Merged

delete blacklisted attachments from message and replace with webhook#520
danthe1st merged 4 commits into
Java-Discord:mainfrom
ayyhimself:ayys-crazy-attachment-remover

Conversation

@ayyhimself

Copy link
Copy Markdown
Contributor

new crazy amazing feature where if someone sends a message with a forbidden attachment then that attachment is removed and the whole message is replaced as a webhook with only the good attachments
works server wide
config in guild config

@ayyhimself
ayyhimself requested a review from a team as a code ownerJuly 11, 2025 18:31

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address the changes I wrote in the review comments.

Also, please use a proper/professional commit message. You can change the commit message of your existing commit using git commit --amend (optionally with -m <message>) and then force-pushing to your branch with git push --force-with-lease.

Comment threadsrc/main/java/net/discordjug/javabot/data/config/GuildConfig.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java Outdated
@danthe1st

Copy link
Copy Markdown
Member

Please also fix the checkstyle errors. We use tabs for indentation.

@ayyhimself
ayyhimselfforce-pushed the ayys-crazy-attachment-remover branch from 699283b to a2b3d33CompareAugust 3, 2025 15:07

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please see the comments.

Other things to eventually convert to a filter:

  • AutoMod (please do this in this PR)
  • suggestions (can be another PR)
  • code formatting in help channel (can be in another PR)

It might als be a good idea to add an overload to WebhookUtil.replaceMessage without embeds/attachments to make the code simpler instead of having to add a null argument wherever calling it.

Comment threadsrc/main/java/net/discordjug/javabot/data/config/GuildConfig.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/handler/HugFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/handler/HugFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java Outdated
@ayyhimself
ayyhimselfforce-pushed the ayys-crazy-attachment-remover branch from a2b3d33 to 2d539abCompareAugust 16, 2025 14:43
@ayyhimself

ayyhimself commented Aug 16, 2025

Copy link
Copy Markdown
ContributorAuthor

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also fix the CI failures.

Comment threadsrc/main/java/net/discordjug/javabot/util/MessageActionUtils.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/util/WebhookUtil.java
@ayyhimself
ayyhimselfforce-pushed the ayys-crazy-attachment-remover branch from 2d539ab to 1cb7604CompareAugust 16, 2025 17:10

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please still fix the CI failures.

@ayyhimself
ayyhimselfforce-pushed the ayys-crazy-attachment-remover branch from 1cb7604 to 1bc0ebdCompareAugust 19, 2025 15:38
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/HugFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageContent.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageContent.java Outdated
@ayyhimself
ayyhimselfforce-pushed the ayys-crazy-attachment-remover branch from 1bc0ebd to 5ab7962CompareAugust 22, 2025 20:36
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageContent.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageContent.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated

@danthe1stdanthe1st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

testing results

Comment threadsrc/main/java/net/discordjug/javabot/data/config/GuildConfig.java Outdated
Comment threadsrc/main/java/net/discordjug/javabot/listener/filter/MessageFilter.java Outdated
@danthe1st
danthe1st merged commit cf93f9e into Java-Discord:mainAug 24, 2025
2 checks passed
Sign up for freeto 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

@ayyhimself@danthe1st