This commit is contained in:
Jannes Höke 2016-05-25 23:57:29 +02:00
parent 8278779a23
commit b3142d2974
4 changed files with 7 additions and 11 deletions

View file

@ -79,7 +79,7 @@ def error(bot, update, error):
def main():
global job_queue
updater = Updater("148447715:AAH4M0gzPG11_mdQS1Qeb0Ex30I5-rw9bMY")
updater = Updater("TOKEN")
job_queue = updater.job_queue
# Get the dispatcher to register handlers

View file

@ -33,6 +33,6 @@ from .stringregexhandler import StringRegexHandler
from .typehandler import TypeHandler
__all__ = ('Dispatcher', 'JobQueue', 'Job', 'Updater', 'CallbackQueryHandler',
'ChosenInlineResultHandler', 'CommandHandler', 'Handler',
'InlineQueryHandler', 'MessageHandler', 'Filters', 'RegexHandler',
'StringCommandHandler', 'StringRegexHandler', 'TypeHandler')
'ChosenInlineResultHandler', 'CommandHandler', 'Handler', 'InlineQueryHandler',
'MessageHandler', 'Filters', 'RegexHandler', 'StringCommandHandler',
'StringRegexHandler', 'TypeHandler')

View file

@ -103,8 +103,8 @@ class JobQueue(object):
job.run()
except:
self.logger.exception('An uncaught error was raised while executing job %s'
% job.name)
self.logger.exception(
'An uncaught error was raised while executing job %s' % job.name)
else:
self.logger.debug('Skipping disabled job %s' % job.name)

View file

@ -65,11 +65,7 @@ class Updater(object):
ValueError: If both `token` and `bot` are passed or none of them.
"""
def __init__(self,
token=None,
base_url=None,
workers=4,
bot=None):
def __init__(self, token=None, base_url=None, workers=4, bot=None):
if (token is None) and (bot is None):
raise ValueError('`token` or `bot` must be passed')
if (token is not None) and (bot is not None):