■ ■ ■ ■ ■ ■
src/telepathy/telepathy.py
| skipped 29 lines |
30 | 30 | | evaluate_reactions, |
31 | 31 | | ) |
32 | 32 | | |
33 | | - | from telethon.tl.functions.messages import GetHistoryRequest |
| 33 | + | from telethon.tl.functions.messages import GetHistoryRequest, GetDialogsRequest |
34 | 34 | | from telethon.tl.types.messages import Messages |
35 | 35 | | from telethon.errors import SessionPasswordNeededError, ChannelPrivateError |
36 | 36 | | from telethon.tl.types import ( |
| skipped 6 lines |
43 | 43 | | ChannelParticipantCreator, |
44 | 44 | | ChannelParticipantAdmin, |
45 | 45 | | ) |
46 | | - | from telethon.tl.functions.messages import GetDialogsRequest |
| 46 | + | from telethon.tl.functions.users import GetFullUserRequest |
47 | 47 | | from telethon import TelegramClient, functions, types, utils |
48 | 48 | | from telethon.utils import get_display_name, get_message_id |
49 | 49 | | from alive_progress import alive_bar |
| skipped 1563 lines |
1613 | 1613 | | self.login = os.path.join(self.telepathy_file,"login.txt") |
1614 | 1614 | | self.log_file = os.path.join(self.telepathy_file,"log.csv") |
1615 | 1615 | | self.export_file = os.path.join(self.telepathy_file,"export.csv") |
1616 | | - | |
1617 | 1616 | | self.create_path(self.telepathy_file) |
1618 | 1617 | | self.overlaps_dir = os.path.join(self.telepathy_file,"overlaps") |
| 1618 | + | self.bots_dir = os.path.join(self.telepathy_file, "bots") |
1619 | 1619 | | self.create_path(self.overlaps_dir) |
1620 | 1620 | | self.target = target |
1621 | 1621 | | self.create_tg_client() |
| skipped 199 lines |
1821 | 1821 | | print_shell("location_report", distance_obj) |
1822 | 1822 | | |
1823 | 1823 | | async def analyze_bot(self): |
1824 | | - | ###TODO |
1825 | 1824 | | if ":" in self.bot: |
1826 | 1825 | | _bot_id = self.bot.split(":")[0] |
1827 | 1826 | | _bot_hash = self.bot.split(":")[1] |
1828 | 1827 | | else: |
1829 | 1828 | | color_print_green( |
1830 | 1829 | | " [!] ", |
1831 | | - | "The bot_id/bot_hash isn't valid. Pls insert a valid api_id//api_hash", |
| 1830 | + | "The bot_id:bot_hash isn't valid. Pls insert a valid bot_id:bot_hash", |
1832 | 1831 | | ) |
| 1832 | + | |
| 1833 | + | print( |
| 1834 | + | Fore.GREEN |
| 1835 | + | + " [!] " |
| 1836 | + | + Style.RESET_ALL |
| 1837 | + | + "Searching info about this bot id: " |
| 1838 | + | + _bot_id |
| 1839 | + | + "\n" |
| 1840 | + | ) |
| 1841 | + | |
| 1842 | + | bot_info = await self.client().start(bot_token=self.bot) |
| 1843 | + | bot_me = bot_info.get_me() |
| 1844 | + | user = await bot_info(GetFullUserRequest(bot_me)) |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | user_info = user.user.to_dict() |
| 1848 | + | user_info['token'] = self.bot |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | ''' |
| 1852 | + | color_print_green(" [+] ", "Bot details for " + obj.id) |
| 1853 | + | color_print_green(f" â Username: @{str(obj.username)}") |
| 1854 | + | color_print_green(f" â Name: {str(obj.first_name)}") |
| 1855 | + | color_print_green(f" â Link: https://t.me/{str(obj.username)}") |
| 1856 | + | print("\n") |
| 1857 | + | color_print_green(" [+] ", "User related details for bot " + obj.id) |
| 1858 | + | color_print_green(f" â User id: @{str(obj.user_id)}") |
| 1859 | + | color_print_green(f" â User username: @{str(obj.user_username)}") |
| 1860 | + | color_print_green(f" â User name: {str(obj.user_first_name)}") |
| 1861 | + | color_print_green(f" â Link: https://t.me/{str(obj.user_username)}") |
| 1862 | + | ''' |
| 1863 | + | |
| 1864 | + | bot_obj = createPlaceholdeCls() |
| 1865 | + | bot_obj.id = bot_me.id |
| 1866 | + | bot_obj.first_name = bot_me.first_name |
| 1867 | + | bot_obj.username = bot_me.username |
| 1868 | + | |
| 1869 | + | bot_obj.user_id = user.user.id |
| 1870 | + | bot_obj.user_username = user.user.username |
| 1871 | + | bot_obj.user_first_name = bot_me.user_first_name |
| 1872 | + | |
| 1873 | + | ###TODO FIX TYPE, TEST, SAVEFILE EXPLORE/DUMP CHAT HISTORY |
| 1874 | + | print_shell("bot",bot_obj ) |
1833 | 1875 | | |
1834 | 1876 | | @staticmethod |
1835 | 1877 | | def reiterate_overlaps(dp, dp2, join): |
| skipped 195 lines |