예제 #1
0
def bot_post_logic(sid, sauthor, comment):
    """
    Logic for each post
    :param sid:
    :param sauthor:
    :param comment:
    :return:
    """
    cid = comment.id
    try:
        cauthor = comment.author.name
    except AttributeError:
        return

    if cauthor.lower() == REDDIT_CLIENT.user.name.lower():
        return

    if DBManager.is_oldpost(cid):
        return
    DBManager.add_oldpost(cid)

    cbody = comment.body.lower()
    if TRIGGER.lower() in cbody:
        OfferManager.on_trigger(sid, sauthor, comment)