def test_equality(self):
        a = telegram.Location(self.longitude, self.latitude)
        b = telegram.Location(self.longitude, self.latitude)
        d = telegram.Location(0, self.latitude)

        self.assertEqual(a, b)
        self.assertEqual(hash(a), hash(b))
        self.assertIsNot(a, b)

        self.assertNotEqual(a, d)
        self.assertNotEqual(hash(a), hash(d))
Ejemplo n.º 2
0
    def test_send_location_with_location(self):
        loc = telegram.Location(longitude=self.longitude,
                                latitude=self.latitude)
        message = self._bot.send_location(location=loc, chat_id=self._chat_id)
        location = message.location

        self.assertEqual(location, loc)
Ejemplo n.º 3
0
    def test_equality(self):
        a = telegram.Venue(telegram.Location(0, 0), "Title", "Address")
        b = telegram.Venue(telegram.Location(0, 0), "Title", "Address")
        c = telegram.Venue(telegram.Location(0, 0), "Title", "Not Address")
        d = telegram.Venue(telegram.Location(0, 1), "Title", "Address")
        d2 = telegram.Venue(telegram.Location(0, 0), "Not Title", "Address")

        self.assertEqual(a, b)
        self.assertEqual(hash(a), hash(b))
        self.assertIsNot(a, b)

        self.assertEqual(a, c)
        self.assertEqual(hash(a), hash(c))

        self.assertNotEqual(a, d)
        self.assertNotEqual(hash(a), hash(d))

        self.assertNotEqual(a, d2)
        self.assertNotEqual(hash(a), hash(d2))
Ejemplo n.º 4
0
    def setUp(self):
        self.location = telegram.Location(longitude=1., latitude=0.)
        self.title = 'title'
        self._address = '_address'
        self.foursquare_id = 'foursquare id'

        self.json_dict = {
            'location': self.location.to_dict(),
            'title': self.title,
            'address': self._address,
            'foursquare_id': self.foursquare_id
        }
Ejemplo n.º 5
0
    def setUp(self):
        user = telegram.User(1, 'First name')
        location = telegram.Location(8.8, 53.1)

        self.id = 'id'
        self.from_user = user
        self.query = 'query text'
        self.offset = 'offset'
        self.location = location

        self.json_dict = {
            'id': self.id,
            'from': self.from_user.to_dict(),
            'query': self.query,
            'offset': self.offset,
            'location': self.location.to_dict()
        }
Ejemplo n.º 6
0
def send_location(p, lat, lon):
    loc = telegram.Location(lon, lat)
    BOT.send_location(p.chat_id, location=loc)
Ejemplo n.º 7
0
# String Constants
__DOLAR = get_dolar_value()
DOLAR_STR = __DOLAR[0]
DOLAR_FLOAT = __DOLAR[1]

EXCHANGE_VALUE = f"La Tasa de cambio que manejamos usualmente es la tasa promedio, actualmente es de:\n {DOLAR_STR}"


def START_INFO(name: str = ""):
    return (
        f'¡Hola {name}! Soy un bot encargado de ayudarte con tus compras en la Panaderia Mass Pan, sin embargo, aun '
        f'me encuentro en desarrollo, puedes escribirle a nuestro equipo @MassPan o al número de telefono +58 412 773 6899 '
        f'para resolver tu dudas\n\n'
        f'Puedes moverte usando nuestro menu, o escribir algún producto en el que estes interesado\n'
        f'\n Y recuerda <b>¡¡Mass Sabor con Mass Pan!!</b>'
        f'\n\n Contactanos con las siguentes apps'
        f'\n  👇👇👇👇👇👇👇👇👇👇👇👇')


SCHEDULE = (
    "Actualmente nuestro horario es de:\n Lunes A Viernes:\n\n 8 A.M. hasta las 4 P.M.\n\n<b> En horario corrido </b>"
)

LOCATION = "Nos encontramos en Urb. Independencia, 1 Era Etapa, calle 23 (calle siguente a la Urb. Tomas Marzal) frente" \
           " al autolavado, Coro (Venezuela)"

DEVELOPER_INFO = "Este Bot esta siendo actualmente desarrollado por Edkar Chachati. Redes sociales:\n\n"

gps_location = telegram.Location(latitude=11.423235, longitude=-69.640745)
Ejemplo n.º 8
0
def send_location(p, lat, lon):
    loc = telegram.Location(lon, lat)
    BOT.send_location(get_chat_id(p), location=loc)