minimum comments user defined variable

pull/915/head
anthony lloyd 3 years ago
parent 45cc78eae6
commit 312d25c680

@ -13,6 +13,7 @@ max_comment_length = { optional = false, example = 500, explanation = "max numb
post_lang = { optional = true, example = "es-cr", explanation = "The language you would like to translate to.", default = "" } post_lang = { optional = true, example = "es-cr", explanation = "The language you would like to translate to.", default = "" }
sort = { optional = true, example = "hot ,top, relevance, new", explanation = "method of sorting threads", default = "top", options = ["hot", "top", "relevance", "new"] } sort = { optional = true, example = "hot ,top, relevance, new", explanation = "method of sorting threads", default = "top", options = ["hot", "top", "relevance", "new"] }
sort_time = { optional = true, example = "day, hour, week, month, year, all", explanation = "time range to gather threads from", default = "all", options = ["day", "hour", "week", "month", "year", "all"] } sort_time = { optional = true, example = "day, hour, week, month, year, all", explanation = "time range to gather threads from", default = "all", options = ["day", "hour", "week", "month", "year", "all"] }
min_comments = { optional = true, example = "100", explanation = "dont allow threads with amount of comments bellow this value", default = "100", type = "int", nmin = 0 }
[settings] [settings]
allow_nsfw = { optional = false, example = "false", explanation = "Whether to allow NSFW content, True or False", default = false, options = [true, false], type = "bool" } allow_nsfw = { optional = false, example = "false", explanation = "Whether to allow NSFW content, True or False", default = false, options = [true, false], type = "bool" }

@ -34,8 +34,14 @@ def get_subreddit_undone(submissions: list, subreddit):
if submission.stickied: if submission.stickied:
print_substep("This post was pinned by moderators. Skipping...") print_substep("This post was pinned by moderators. Skipping...")
continue continue
if submission.num_comments < 100: if submission.num_comments < 0:
print_substep("This post has less than 100 comments. Skipping...") print_substep("This post has 0 comments. Skipping...")
continue
try:
if submission.num_comments < settings.config["reddit"]["thread"]["min_comments"]:
print_substep("This post has less than user defined minimum comments, Skipping...")
continue
except AttributeError:
continue continue
return submission return submission
print("all submissions have been done going by top submission order") print("all submissions have been done going by top submission order")

Loading…
Cancel
Save