Skip to content

Conversation

kyrazzx
Copy link
Contributor

@kyrazzx kyrazzx commented Sep 22, 2025

I've updated the filterbot.py file to use collections.deque to improve the logic and efficiency of the bot. This gives more readable and maintainable code.

I also simplified some of the simple logic flow, e.g. this if block to a less messy 3-liner.

I also reformatted a couple of small things within filterbot.py

@faretek1
Copy link
Collaborator

faretek1 commented Sep 22, 2025

Ignore the failed test workflow.


I would need to check this before I have any opinion on merging. If others, e.g. TheCommCraft say it's good, then that's ok too.

@kyrazzx
Copy link
Contributor Author

kyrazzx commented Sep 24, 2025

Ignore the failed test workflow.

I would need to check this before I have any opinion on merging. If others, e.g. TheCommCraft say it's good, then that's ok too.

alright thanks

@faretek1
Copy link
Collaborator

faretek1 commented Sep 29, 2025

i'll try checking this out right now. How thoroughly have you tested this?

feat: return from comment.delete
feat: log message and headers of deletion request
fix: return response, not headers from project delete comment TimMcCool#497
fix: no error handling on user delete comment
Copy link
Collaborator

@faretek1 faretek1 left a comment

Choose a reason for hiding this comment

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

i made a few fixes. It works on my machine (i've been testing here, and my f4f/ad comments are getting deleted, which indicates that the Hardfilters and Softfilters are working as expected.

I will just test Spamfilter, then ask TheCommCraft for any comments.

f"https://api.scratch.mit.edu/proxy/comments/project/{self.id}/comment/{comment_id}/",
headers=self._headers,
cookies=self._cookies,
).headers
Copy link
Collaborator

Choose a reason for hiding this comment

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

I removed the headers here so that both project.delete_comment and user.delete_comment return a requests.response object. see #497

Copy link
Collaborator

@faretek1 faretek1 left a comment

Choose a reason for hiding this comment

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

spam filter works. @TheCommCraft, any comments?

@faretek1 faretek1 merged commit feb8200 into TimMcCool:main Sep 30, 2025
1 check passed
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.

3 participants