mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-01-03 09:49:21 +01:00
22 lines
536 B
Python
22 lines
536 B
Python
#!/usr/bin/env python
|
|
|
|
|
|
from .base import TelegramObject
|
|
|
|
|
|
class Location(TelegramObject):
|
|
def __init__(self,
|
|
longitude,
|
|
latitude):
|
|
self.longitude = longitude
|
|
self.latitude = latitude
|
|
|
|
@staticmethod
|
|
def de_json(data):
|
|
return Location(longitude=data.get('longitude', None),
|
|
latitude=data.get('latitude', None))
|
|
|
|
def to_dict(self):
|
|
data = {'longitude': self.longitude,
|
|
'latitude': self.latitude}
|
|
return data
|