add another db toggle for discord

graphs-n-shit
lza_menace 4 years ago
parent 7d7caf803d
commit 59ece469a5

@ -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)

@ -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

Loading…
Cancel
Save