diff --git a/suchwow/app.py b/suchwow/app.py index 0a513cc..a25d262 100644 --- a/suchwow/app.py +++ b/suchwow/app.py @@ -72,7 +72,7 @@ def create_accounts(): @app.cli.command("post_new_memes") def post_new_memes(): # run every 5 mins - all_posts = Post.select().order_by(Post.timestamp.desc()).where(Post.to_reddit == False) + all_posts = Post.select().order_by(Post.timestamp.desc()).where(Post.to_reddit == False, Post.to_discord == False) for post in all_posts: diff = datetime.now() - post.timestamp recent_post = diff < timedelta(hours=2) diff --git a/suchwow/models.py b/suchwow/models.py index 02bfb3d..3fb6b91 100644 --- a/suchwow/models.py +++ b/suchwow/models.py @@ -18,6 +18,7 @@ class Post(Model): timestamp = DateTimeField(default=datetime.now) reddit_url = CharField(null=True) to_reddit = BooleanField(default=False) + to_discord = BooleanField(default=False) class Meta: database = db