Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit9311faf

Browse files
author
PokestarFan
committed
More changes
1 parent5844377 commit9311faf

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

‎delete.py‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22
frommodules.loggerimportsetup_logger
33
frommodules.loginimportreddit
44
importlogging
5+
importtime
56

67
logger=setup_logger('user_removed_comments')
78

8-
foriteminreddit.inbox.stream():
9-
logger.debug('On item {}'.format(str(item)))
9+
10+
defmain():
1011
try:
11-
ifitem.body.lower()=='delete':
12-
item.parent.delete()
13-
logging.info('Comment {} removed'.format(str(item.parent)))
14-
item.reply('The top level post has been removed.')
12+
foriteminreddit.inbox.comment_replies(limit=30):
13+
logger.debug('On item {}'.format(str(item)))
14+
print(item.body)
15+
try:
16+
if'delete'initem.body.lower():
17+
item.parent.delete()
18+
logging.info('Comment {} removed'.format(str(item.parent)))
19+
item.reply('The top level post has been removed.')
20+
except:
21+
logging.debug('Item {} skipped'.format(str(item)))
1522
except:
16-
logging.debug('Item {} skipped'.format(str(item)))
17-
pass
23+
logging.debug('Error!',exc_info=True)
24+
main()
25+
26+
whileTrue:
27+
main()
28+
time.sleep(30)

‎duplicate.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def action():
3636
message='Here is a list of threads in other subreddits about the same content:\n'
3737
fordupinduplicates:
3838
message=str(message+'\n * [{}]({}) on /r/{} with {} karma (created at {} by {})').format(dup['title'],dup['link'],dup['subreddit'],dup['karma'],dup['time'],dup['author'])
39-
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)'
39+
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)\n\n^^Now ^^you ^^can ^^remove ^^the ^^comment ^^by ^^replying ^^delete!'
4040
try:
4141
submission.reply(message)
4242
logger.info('Message posted on {}'.format(sub_id))

‎run.bat‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@echooff
2-
py duplicate.py
3-
run.bat
2+
start py duplicate.py
3+
start py delete.py
4+
start py lowpostremover.py

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp