foxxmd / context-mod Goto Github PK
View Code? Open in Web Editor NEWan event-based, reddit moderation bot built on top of snoowrap and written in typescript
Home Page: https://contextmod.dev
License: MIT License
an event-based, reddit moderation bot built on top of snoowrap and written in typescript
Home Page: https://contextmod.dev
License: MIT License
Implement run()
in abstract class to handle run/skip based on include/exclude criteria
Is there an env to use redis? I had assumed PROVIDER_STORE=redis
would work.
There are some good pointers in the ui but would be good to document in a readme along with hierarchy/tuning/etc.
Reddit returns good information about Submissions with media links (youtube, vimeo, etc.)
Taking a page out of toolbox's playbook:
secure_media.oembed.author_url
author_url
count (variant with useSubmissionAsReference
)Based on the description of karma farming from this thread.
Check the content of a comment activity against a list of "top" text comments based (and retrieved from) on the submission source:
https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&order=relevance&part=snippet&filter=snippet&videoId={VIDEO_ID}&maxResults=100
For detecting a match:
cache retrieved comments using a unique id based on submission source
Restricting subreddit search
https://reddit.com/r/mealtimevideos+videos/search?q=${QUERY}&restrict_sr=1
Search by submission url
?someQueryParam=...
since reddit seems to only search by base urlurl
token in query to search by url IE .../search?q=url:${BASE_URL}
"Depleted in ~2 hours".
Does 2 hours signify an issue?
Is 2 hours a good thing?
I'd be great to allow both filtering by a string/regex and enabling the types of messages being output for example.
It'd be nice to enable/disable Reddit API Stats: Initial 582 | Current 582 | Used ~0 | Events ~0.11/s
in the web logs. Same for this line Run Stats: Checks 1 | Rules => Total: 1 Unique: 1 Cached: 0 Rolling Avg: ~null/s | Actions 0
.
2021-10-20T22:43:49+00:00 warn : ~u/username~ {r/subreddit} [COM ID] [CHK low xp comment spam] Running rules failed due to uncaught exception Reddit returned a 404 for user history. Likely this user is shadowbanned.
SimpleError: Reddit returned a 404 for user history. Likely this user is shadowbanned.
at Object.getAuthorActivities (CWD/src/Utils/SnoowrapUtils.js:92:19)
at async cacheVal.cache.wrap.ttl (CWD/src/Subreddit/SubredditResources.js:340:24)
Current dockerfile dependencies stem from when CM was using node-canvas
for image comparison. It has been replaced by sharp, which only depends on libvips
and may already be built into alpine...need to test what can be removed.
Currently you can load but not save the config from the editor.
Implement cloud templates so new users can deploy a working bot without having to figure out infrastructure.
Currently cdnjs.cloudflare.com
is used for some CSS.
Enabling redis caching while in monolith mode I had assumed without a sub/op config the app would take this env and also cache reddit posts/comments but checking redis I'm not seeing anything but web sessions.
There needs to be a page/section in the web ui where you can see the rules parsed into nice html elements. Similar to how the actioned events page maybe?
A mod may want any other bots processing activities to run before RCB. This could be achieved by:
Not really context bot specific but it would be super helpful if the viewer also used/displayed the examples I've annotated. Will probably need to run the viewer locally and debug.
I'd like to see a page with the results for every check that's run as well as a button to rerun the check on that post/comment.
If a submission or comment already has been replied to (at top level) from a moderator (or automod) then we don't want to also perform actions on it as we can assume it's already been manually actioned.
This shouldn't be an issue if the bot is using a fast poll time but want to cover all the bases.
Seems that actioned events max kept is based on total events not actioned ones meaning after x events the "actions events" page is cleared.
Need to make action classes actually do something
So that users can pre-define mustache rendering fragments for a rule
partials
property to rule json that is parsed on startuppartials
property to be a string (one partial, name of rule) or object so many partials can be defined per rulewiki:
discriminator that retrieves wiki page contents that should then renderIt'd be nice to not only be able to check a permalink but a whole user. This would be great for new spam as we could add the new spam rule and then run it against that whole account removing all their posts.
Need to encapsulate rule/action running in try-catch so they can fail but application can continue
Either a modal or a window popup should open with the results. Currently there isn't really any user feedback for submitting a link apart from the link disappearing.
If a page doesn't specify a lang attribute, a screen reader assumes that the page is in the default language that the user chose when setting up the screen reader. If the page isn't actually in the default language, then the screen reader might not announce the page's text correctly. Learn more.
If the bot performs an action that submits content (comment, report) it should contain a footer saying:
So i can run it on the server
Implement alternate property to allow pulling content from a wiki page.
Right now would need to pass all prefix content down from config builder all the way to action/rule if I want to see the context for some log statement on write. Need to refactor this so a logger can be created from a pool or something with prefix content already built. Basically make it more stateless to create a logger.
Once api is stable document endpoints and provide samples for authentication/usage
Create some well-documented common configurations that be used as a teaching tool as well as a valid jumping off point for new users.
Would like to integrate with toolbox usernotes to enable mod interaction tracking:
Integration requirements
Implementation
Noticed this in my logs.
Checks 1 | Rules => Total: 1 Unique: 1 Cached: 0 Rolling Avg: ~null/s | Actions 0
Originally suggested as being able to check for a hiatus/gap here by u/SillyStranger5009
Some examples of things that could be checked (to build a rule against):
How to apply?
Instead of showing the full link at the end of the log maybe [COM ID]
could link to it?
Used the heroku link and then provided it the needed envs.
The site shows a heroku error and when trying to connect via heroku run bash
it never connects.
It's just forever showing Running bash on ⬢ context-mod... / connecting, run.4890 (Hobby)
.
Any ideas if this is a heroku issue or something with the deploy?
Right now all rule result summary data is uncensored IE thresholds, exact windows/totals are revealed in the text.
Need to implement user-facing summaries that redact specific, critical values so that spammers/bad-actors can't determine how to fly under the rader on triggering rules OR make sure there is enough raw data in the rule results for mods to build it themselves.
TODO before public announcement:
Places to post announcement:
Would be cool to get Discord webhooks or something so that user can notified, outside of reddit, when a critical check runs
May be worthwhile to replicate repost sleuth bot on a (much) smaller level IE subreddit/bot level.
Things that would need to be or need to be considered...
When
Implement a way to compare submission image to images from submissions in history.
Notes:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.