|
| 1 | +import asyncio |
| 2 | +import requests |
| 3 | +import os |
| 4 | +import logging |
| 5 | +import time |
| 6 | +import string |
| 7 | +import random |
| 8 | +import html |
| 9 | + |
| 10 | +# for fake dats. |
| 11 | +from faker import Faker |
| 12 | +from faker.providers import internet |
| 13 | + |
| 14 | +# telethon |
| 15 | +from telethon import events, Button, TelegramClient |
| 16 | +from telethon.tl import functions, types |
| 17 | +from telethon.tl.functions.photos import GetUserPhotosRequest |
| 18 | +from telethon.tl.functions.users import GetFullUserRequest |
| 19 | +from telethon.tl.types import MessageEntityMentionName |
| 20 | +from telethon.utils import get_input_location |
| 21 | + |
| 22 | +logging.basicConfig(level=logging.INFO) |
| 23 | + |
| 24 | +try: |
| 25 | + API_ID = int(os.environ.get("API_ID", 6)) |
| 26 | + API_HASH = os.environ.get("API_HASH", None) |
| 27 | + TOKEN = os.environ.get("TOKEN", None) |
| 28 | +except ValueError: |
| 29 | + print("You forgot to fix or written all vars") |
| 30 | + print("Ping your Issue at https://telegram.me/riz4d ,Now Bot is Exiting.!") |
| 31 | + exit() |
| 32 | +except Exception as e: |
| 33 | + print(f"Bug - {str(e)}") |
| 34 | + print("Ping your Issue at https://telegram.me/riz4d ,Now Bot is Exiting.!") |
| 35 | + exit() |
| 36 | +except ApiIdInvalidError: |
| 37 | + print("API_ID or API_HASH Are Invalid.") |
| 38 | + print("Ping your Issue at https://telegram.me/riz4d ,Now Bot is Exiting.!") |
| 39 | + exit() |
| 40 | + |
| 41 | +bot = TelegramClient('rizad', API_ID, API_HASH) |
| 42 | +rizad = bot.start(bot_token=TOKEN) |
| 43 | + |
| 44 | + |
| 45 | +# Copyright @riz4d |
| 46 | +async def is_admin(event, user): |
| 47 | + try: |
| 48 | + sed = await event.client.get_permissions(event.chat_id, user) |
| 49 | + if sed.is_admin: |
| 50 | + is_mod = True |
| 51 | + else: |
| 52 | + is_mod = False |
| 53 | + except: |
| 54 | + is_mod = False |
| 55 | + return is_mod |
| 56 | + |
| 57 | +@rizad.on(events.NewMessage(pattern="/fakedb")) |
| 58 | +async def hi(event): |
| 59 | + if event.fwd_from: |
| 60 | + return |
| 61 | + if event.is_group: |
| 62 | + if not await is_admin(event, event.message.sender_id): |
| 63 | + await event.reply("`This Action Not Allowed. It can Do By My Master!`") |
| 64 | + return |
| 65 | + fake = Faker() |
| 66 | + print("FAKE DETAILS GENERATED\n") |
| 67 | + name = str(fake.name()) |
| 68 | + fake.add_provider(internet) |
| 69 | + address = str(fake.address()) |
| 70 | + ip = fake.ipv4_private() |
| 71 | + cc = fake.credit_card_full() |
| 72 | + email = fake.ascii_free_email() |
| 73 | + job = fake.job() |
| 74 | + android = fake.android_platform_token() |
| 75 | + pc = fake.chrome() |
| 76 | + await event.reply( |
| 77 | + f"<b><u> Fake Data Generated</b></u>\n<b>Name :- </b><code>{name}</code>\n\n<b>Address:- </b><code>{address}</code>\n\n<b>IP ADDRESS:- </b><code>{ip}</code>\n\n<b>credit card:- </b><code>{cc}</code>\n\n<b>Email Id:- </b><code>{email}</code>\n\n<b>Job:- </b><code>{job}</code>\n\n<b>android user agent:- </b><code>{android}</code>\n\n<b>Pc user agent:- </b><code>{pc}</code>", |
| 78 | + parse_mode="HTML", |
| 79 | + ) |
| 80 | + |
| 81 | +# start handler |
| 82 | + |
| 83 | +@rizad.on(events.NewMessage(incoming=True, pattern="/start")) |
| 84 | +async def start(event): |
| 85 | + if event.is_group: |
| 86 | + await event.reply("**Random Data Bot Is Active**") |
| 87 | + return |
| 88 | + await event.reply(f"**Hey!! {event.sender.first_name}**\nI can generate random Data's of citizens.\n My Master Mind Is Here @riz4d", |
| 89 | + buttons=[ |
| 90 | + [Button.url("Instagram", url="https://instagram.com/rizad__x96")], |
| 91 | + [Button.inline("Help",data="help")] |
| 92 | + ]) |
| 93 | + |
| 94 | +@rizad.on(events.callbackquery.CallbackQuery(data="help")) |
| 95 | +async def ex(event): |
| 96 | + await event.edit("**Heyy Dude it's not aa complecated task just type `/fakedb`.**\n : **Queries @riz4d**") |
| 97 | + |
| 98 | +print ("Hosted Successfully") |
| 99 | +rizad.run_until_disconnected() |
0 commit comments