示例#1
0
def __clear(args):
    if len(args)==1 and args[0]=='clear':
        cmd=raw_input("All data will be removed and it can not be restored, are you sure?[Y/N]")
        if cmd.lower()=='y':
            db.clear()
            return True
        print 'you canceled the command.'
        return True
    return False
示例#2
0
def main():
    telegram_token = os.environ['TELEGRAM_TOKEN']
    vk_client_id = os.environ['VK_CLIENT_ID']

    args = sys.argv[1:]
    if len(args) > 0:
        print('Launched with arguments: ' + str(args))
        if args[0] == 'reset-db':
            print('Resetting db')
            db.clear()
            db.sync()

    bot = Bot(token=telegram_token, vk_client_id=vk_client_id)
    bot.run()
示例#3
0
def main():
    telegram_token = os.environ['TELEGRAM_TOKEN']
    vk_client_id = os.environ['VK_CLIENT_ID']

    args = sys.argv[1:]
    if len(args) > 0:
        print('Launched with arguments: ' + str(args))
        if args[0] == 'reset-db':
            print('Resetting db')
            db.clear()
            db.sync()

    bot = Bot(token=telegram_token,
              vk_client_id=vk_client_id)
    bot.run()