Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Adding an item to a list of variables?
Post Body

So a bot I run has the following code in it:

mods = list(r.subreddit('alcohol').moderator())
    comments = r.subreddit('alcohol').comments(limit=50)
    for comment in comments:
        if 'jerry' in comment.body.lower():
          if comment.id not in open('comments.txt','r').read().split('\n'):
            for trigger, rule in rule_triggers.items():
                if trigger in comment.body.lower() and comment.id not in open('comments.txt','a ').read().split('\n') and comment.author in mods:

Now the important part is that last line. It checks for the trigger word (jerry) followed by the specific rule trigger word, checks to see if it's dealt with this comment already (in comments.txt), and if the person using the trigger is a moderator of the subreddit (the mods list).

What I'd like to do is take the mods list variable, and add to it (sort of like adding a trusted non-moderator user). Is there an easy way to add this extra username to the mods variable?

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
19,425
Link Karma
6,051
Comment Karma
13,278
Profile updated: 3 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago