Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit c21618d

Browse files
author
PokestarFan
committed
More bugfixes
1 parent 6d25ae6 commit c21618d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

duplicate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ def action():
2727
with open('blockusers.txt','r') as newfile:
2828
for line in newfile.readlines():
2929
line = line.strip('\n')
30-
if str(submission.author) == line or 'bot' in str(submission.author):
30+
if str(submission.author) == line or 'bot' in str(submission.author).lower():
3131
blockeduser = 1
3232
logger.debug('User {}\'s submission {} was blocked from posting'.format(str(submission.author),str(sub_id)))
3333
else:
3434
pass
3535
if blockeduser == 0:
3636
for duplicate in submission.duplicates():
3737
dup_sub = praw.models.Submission(reddit, id = duplicate)
38-
if 'imagesof' not in str(dup_sub.subreddit).lower() and 'auto' not in str(dup_sub.subreddit).lower():
38+
if 'imagesof' not in str(dup_sub.subreddit).lower() and 'auto' not in str(dup_sub.subreddit).lower() and 'bot' not in str(dup_sub.author).lower():
3939
time = dup_sub.created
4040
time = str(datetime.fromtimestamp(time))
4141
author = str(dup_sub.author)
@@ -46,7 +46,7 @@ def action():
4646
message = 'Here is a list of threads in other subreddits about the same content:\n'
4747
for dup in duplicates:
4848
message = str(message + '\n * [{}]({}) on /r/{} with {} karma (created at {} by {})').format(dup['title'], dup['link'], dup['subreddit'], dup['karma'],dup['time'], dup['author'])
49-
message = message + '\n\n ---- \n\n ^^I ^^am ^^a ^^bot ^^[FAQ](https://www.reddit.com/r/DuplicatesBot/wiki/index)-[Code](https://github.com/PokestarFan/DuplicateBot-[Bugs](https://www.reddit.com/r/DuplicatesBot/comments/6ypgmx/bugs_and_problems/)-[Suggestions](https://www.reddit.com/r/DuplicatesBot/comments/6ypg85/suggestion_for_duplicatesbot/)-[Block](https://www.reddit.com/r/DuplicatesBot/wiki/index#wiki_block_bot_from_tagging_on_your_posts)'
49+
message = message + '\n\n ---- \n\n ^^I ^^am ^^a ^^bot ^^[FAQ](https://www.reddit.com/r/DuplicatesBot/wiki/index)-[Code](https://github.com/PokestarFan/DuplicateBot)-[Bugs](https://www.reddit.com/r/DuplicatesBot/comments/6ypgmx/bugs_and_problems/)-[Suggestions](https://www.reddit.com/r/DuplicatesBot/comments/6ypg85/suggestion_for_duplicatesbot/)-[Block](https://www.reddit.com/r/DuplicatesBot/wiki/index#wiki_block_bot_from_tagging_on_your_posts)'
5050
try:
5151
submission.reply(message)
5252
logger.info('Message posted on {}'.format(sub_id))

0 commit comments

Comments
 (0)