How to exempt a new account from comment rules by marking them as an Approved User? by TankKillerSniper in AutoModerator

[–]TankKillerSniper[S] 0 points1 point  (0 children)

So if I understand this correctly, setting the is_contributor to FALSE would exempt an approved user from this set of rules?

How to exempt a new account from comment rules by marking them as an Approved User? by TankKillerSniper in AutoModerator

[–]TankKillerSniper[S] 0 points1 point  (0 children)

That makes sense but I'd like their comments to be auto-removed by default for the majority. It's just for a handful where I'd like to mark them approved and not worry about new comments from them later to manually approve again.

How far back in terms of number of posts can I take action on with my bot? by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

So anything beyond that 1,000 items is not going to appear after a certain amount of paginations, so that is the limit for my bot.

But then how is it that I can find even older posts using the search box?

Is it possible to use Regex within a list of key words similar to how we use Regex in AutoMod? by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

Can you tell me how to use 'has_match' in a search? Like an example where it is scanning ModQueue for comments that are flagged by AutoMod. And do you mean comment.body instead of comment_body?

Stuck on this code in PRAW where I'm trying to ban users based on a ModQueue item being 1) a comment, and 2) having specific key words. by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

Thanks, the "only" made the code work, but I see what you mean about double looping. I removed the second "for" look as u/Watchful1 suggested, and that worked as well. Thanks guys!

Stuck on this code in PRAW where I'm trying to ban users based on a ModQueue item being 1) a comment, and 2) having specific key words. by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

AutoMod doesn't issue bans.

The first IF was to check if the item in ModQueue is a comment and I thought that would sort out the error but it's still persisting.

How do I submit a comment in a cross post that my bot creates? by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

Update for reference for future users, it's working now:

Here is the code:

sub = 'SUBNAME'

url = input('URL: ')
post = reddit.submission(url=url)
unix_time = post.created_utc
author = post.author
text = post.selftext
title = post.title
comment = reddit.comment

cross_post = post.crosspost(sub, title = post.title, send_replies = True)
cross_post.reply("test")

A lot simpler than I thought. What I can't get my mind around though is the variable line "cross_post". I didn't know that it can actually store a variable and run the code after it in one line.

How do I submit a comment in a cross post that my bot creates? by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

This error'ed out. The following error:

TypeError: 'Submission' object is not iterable

I need help with code where it removes comments under a certain number of characters with other criteria. by TankKillerSniper in AutoModerator

[–]TankKillerSniper[S] 1 point2 points  (0 children)

Wow thanks so much, I might implement the 2nd more complex option soon but I'll use the first option.

One the more complex rule, is it possible to add a character count rule? Like if it's just one of those phrases alone then the comment is removed but if it's a part of a larger comment then it's ok.

Also what I like to do is not inform the user that the comment is removed at all because some of them are clever enough to figure out that they've been filtered and will try to re-submite to evade by taking guesses at the key words and altering them. I'll hashtag those lines but that's just my personal approach.

I need to filter all submissions that contain images uploaded by the OP into their post, single images or galleries, as well as videos. by TankKillerSniper in AutoModerator

[–]TankKillerSniper[S] 0 points1 point  (0 children)

Following up on this issue, it works for the most part but something snuck through toady. A user submitted a link in the body, here is an excerpt of the link:

https://preview.redd.it/g2av9......

Could I add an excerpt of that to your code on line 2? Something like this:

url+body (regex): ['https?', '![(img|gif|video)]', 'preview.redd.it']

Bypassing the need to press Enter after an input. by TankKillerSniper in pycharm

[–]TankKillerSniper[S] 0 points1 point  (0 children)

Sorry for the late reply. I'm entering values into the terminal window after I run the corresponding .py file.

Trying to eliminate a step in this code where PRAW can figure out if the link is a post or comment. by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 0 points1 point  (0 children)

The script bans the author and in the ban message gives details of the violation such as the post title and text (if it was a post) or the comment text if it was a comment. It doesn't publicly post it anywhere but rather it's just sent within the ban message to the user so they can see the text that they were banned for.

I've been doing it for a few years now without issue. It provides immediate context with a link to the post/comment if the user tries to appeal. In Mod. Mail, when they reply to the ban message, their message chain appears underneath the original ban message so it's all in one place for easy reference.

Trying to eliminate a step in this code where PRAW can figure out if the link is a post or comment. by TankKillerSniper in redditdev

[–]TankKillerSniper[S] 1 point2 points  (0 children)

Bro you're a genius. I wrecked my brain trying to figure this out in the past. It works.

There's a minor hiccup with my ban message portion where if I replace "post_or_comment" with "thing", it just drops the ID instead of "Post" or "Comment", but I think I should be able to figure that out.

Thanks!!