Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
Changed glance2() to glance()
Browse files Browse the repository at this point in the history
  • Loading branch information
nickoala committed Feb 6, 2016
1 parent 75783bd commit 4d0b375
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions examples/chatbox_nodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _read_messages(self, messages):
self.sender.sendMessage(msg['text'])

def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if content_type != 'text':
self.sender.sendMessage("I don't understand")
Expand Down Expand Up @@ -110,7 +110,7 @@ def __init__(self, seed_tuple, store, exclude):

# Store every message, except those whose sender is in the exclude list, or non-text messages.
def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if chat_id in self._exclude:
print('Chat id %d is excluded.' % chat_id)
Expand Down
4 changes: 2 additions & 2 deletions examples/chatboxa_nodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _read_messages(self, messages):

@asyncio.coroutine
def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if content_type != 'text':
yield from self.sender.sendMessage("I don't understand")
Expand Down Expand Up @@ -115,7 +115,7 @@ def __init__(self, seed_tuple, store, exclude):

# Store every message, except those whose sender is in the exclude list, or non-text messages.
def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if chat_id in self._exclude:
print('Chat id %d is excluded.' % chat_id)
Expand Down
2 changes: 1 addition & 1 deletion examples/emodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

def handle(msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
m = telepot.namedtuple.namedtuple(msg, 'Message')

if chat_id < 0:
Expand Down
2 changes: 1 addition & 1 deletion examples/emodia.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@asyncio.coroutine
def handle(msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
m = telepot.namedtuple.namedtuple(msg, 'Message')

if chat_id < 0:
Expand Down
2 changes: 1 addition & 1 deletion examples/guess.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def open(self, initial_msg, seed):
return True # prevent on_message() from being called on the initial message

def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if content_type != 'text':
self.sender.sendMessage('Give me a number, please.')
Expand Down
2 changes: 1 addition & 1 deletion examples/guessa.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def open(self, initial_msg, seed):

@asyncio.coroutine
def on_message(self, msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)

if content_type != 'text':
yield from self.sender.sendMessage('Give me a number, please.')
Expand Down
4 changes: 2 additions & 2 deletions examples/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def on_message(self, msg):
flavor = telepot.flavor(msg)

if flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print(self.id, ':', 'Inline Query:', query_id, from_id, query_string)

articles = [{'type': 'article',
Expand All @@ -26,7 +26,7 @@ def on_message(self, msg):
print(self.id, ':', 'Answers sent.')

elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print(self.id, ':', 'Chosen Inline Result:', result_id, from_id, query_string)


Expand Down
4 changes: 2 additions & 2 deletions examples/inlinea.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def on_message(self, msg):
flavor = telepot.flavor(msg)

if flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print(self.id, ':', 'Inline Query:', query_id, from_id, query_string)

articles = [{'type': 'article',
Expand All @@ -29,7 +29,7 @@ def on_message(self, msg):
print(self.id, ':', 'Answers sent.')

elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print(self.id, ':', 'Chosen Inline Result:', result_id, from_id, query_string)


Expand Down
6 changes: 3 additions & 3 deletions examples/pairing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, seed_tuple, timeout):

def on_message(self, msg):
self._count += 1
print '%s %d: %d: %s' % (type(self).__name__, self.id, self._count, telepot.glance2(msg, flavor='normal'))
print '%s %d: %d: %s' % (type(self).__name__, self.id, self._count, telepot.glance(msg, flavor='normal'))

def on_close(self, exception):
print '%s %d: closed' % (type(self).__name__, self.id)
Expand All @@ -32,7 +32,7 @@ def on_message(self, msg):
self._count += 1
flavor = telepot.flavor(msg)

print '%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance2(msg, flavor=flavor))
print '%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance(msg, flavor=flavor))

def on_close(self, exception):
print '%s %d: closed' % (type(self).__name__, self.id)
Expand All @@ -47,7 +47,7 @@ def on_message(self, msg):
self._count += 1
flavor = telepot.flavor(msg)

print '%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance2(msg, flavor=flavor))
print '%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance(msg, flavor=flavor))

def on_close(self, exception):
print '%s %d: closed' % (type(self).__name__, self.id)
Expand Down
6 changes: 3 additions & 3 deletions examples/pairinga.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, seed_tuple, timeout):

def on_message(self, msg):
self._count += 1
print('%s %d: %d: %s' % (type(self).__name__, self.id, self._count, telepot.glance2(msg, flavor='normal')))
print('%s %d: %d: %s' % (type(self).__name__, self.id, self._count, telepot.glance(msg, flavor='normal')))

def on_close(self, exception):
print('%s %d: closed' % (type(self).__name__, self.id))
Expand All @@ -35,7 +35,7 @@ def on_message(self, msg):
self._count += 1
flavor = telepot.flavor(msg)

print('%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance2(msg, flavor=flavor)))
print('%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance(msg, flavor=flavor)))

def on_close(self, exception):
print('%s %d: closed' % (type(self).__name__, self.id))
Expand All @@ -50,7 +50,7 @@ def on_message(self, msg):
self._count += 1
flavor = telepot.flavor(msg)

print('%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance2(msg, flavor=flavor)))
print('%s %d: %d: %s: %s' % (type(self).__name__, self.id, self._count, flavor, telepot.glance(msg, flavor=flavor)))

def on_close(self, exception):
print('%s %d: closed' % (type(self).__name__, self.id))
Expand Down
6 changes: 3 additions & 3 deletions examples/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def handle(msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print 'Normal Message:', content_type, chat_type, chat_id

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print 'Inline Query:', query_id, from_id, query_string

# Compose your own answers
Expand All @@ -31,7 +31,7 @@ def handle(msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print 'Chosen Inline Result:', result_id, from_id, query_string

# Remember the chosen answer to do better next time
Expand Down
6 changes: 3 additions & 3 deletions examples/skeleton_extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def handle(self, msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print('Normal Message:', content_type, chat_type, chat_id)

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Inline Query:', query_id, from_id, query_string)

# Compose your own answers
Expand All @@ -32,7 +32,7 @@ def handle(self, msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Chosen Inline Result:', result_id, from_id, query_string)

# Remember the chosen answer to do better next time
Expand Down
6 changes: 3 additions & 3 deletions examples/skeletona.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def handle(msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print('Normal Message:', content_type, chat_type, chat_id)

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Inline Query:', query_id, from_id, query_string)

# Compose your own answers
Expand All @@ -33,7 +33,7 @@ def handle(msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Chosen Inline Result:', result_id, from_id, query_string)

# Remember the chosen answer to do better next time
Expand Down
6 changes: 3 additions & 3 deletions examples/skeletona_extend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def handle(self, msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print('Normal Message:', content_type, chat_type, chat_id)

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Inline Query:', query_id, from_id, query_string)

# Compose your own answers
Expand All @@ -34,7 +34,7 @@ def handle(self, msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Chosen Inline Result:', result_id, from_id, query_string)

# Remember the chosen answer to do better next time
Expand Down
2 changes: 1 addition & 1 deletion examples/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def on_message(self, msg):

# Have to answer inline query to receive chosen result
if flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)

articles = [{'type': 'article',
'id': 'abc', 'title': 'ABC', 'message_text': 'Good morning'}]
Expand Down
2 changes: 1 addition & 1 deletion examples/trackera.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def on_message(self, msg):

# Have to answer inline query to receive chosen result
if flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)

articles = [{'type': 'article',
'id': 'abc', 'title': 'ABC', 'message_text': 'Good morning'}]
Expand Down
6 changes: 3 additions & 3 deletions examples/webhook_aiohttp_skeletona.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def handle(msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print('Normal Message:', content_type, chat_type, chat_id)

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Inline Query:', query_id, from_id, query_string)

# Compose your own answers
Expand All @@ -32,7 +32,7 @@ def handle(msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print('Chosen Inline Result:', result_id, from_id, query_string)

# Remember the chosen answer to do better next time
Expand Down
2 changes: 1 addition & 1 deletion examples/webhook_flask_deeplinking.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
key_id_map = { 'ghijk' : 123 }

def handle(msg):
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print 'Normal Message:', content_type, chat_type, chat_id

if content_type == 'text':
Expand Down
6 changes: 3 additions & 3 deletions examples/webhook_flask_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def handle(msg):

# normal message
if flavor == 'normal':
content_type, chat_type, chat_id = telepot.glance2(msg)
content_type, chat_type, chat_id = telepot.glance(msg)
print 'Normal Message:', content_type, chat_type, chat_id

# Do your stuff according to `content_type` ...

# inline query - need `/setinline`
elif flavor == 'inline_query':
query_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
query_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print 'Inline Query:', query_id, from_id, query_string

# Compose your own answers
Expand All @@ -34,7 +34,7 @@ def handle(msg):

# chosen inline result - need `/setinlinefeedback`
elif flavor == 'chosen_inline_result':
result_id, from_id, query_string = telepot.glance2(msg, flavor=flavor)
result_id, from_id, query_string = telepot.glance(msg, flavor=flavor)
print 'Chosen Inline Result:', result_id, from_id, query_string

# Remember the chosen answer to do better next time
Expand Down

0 comments on commit 4d0b375

Please sign in to comment.