Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ShivangKakkar/StringSessionBot
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Frds-ubot/FrdsStringSessionBot
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 16 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 9, 2022

  1. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    7ad85ab View commit details
    Browse the repository at this point in the history
  2. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    05d3b31 View commit details
    Browse the repository at this point in the history
  3. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    486083b View commit details
    Browse the repository at this point in the history
  4. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    d4efc51 View commit details
    Browse the repository at this point in the history
  5. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    b870b3e View commit details
    Browse the repository at this point in the history
  6. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    0579402 View commit details
    Browse the repository at this point in the history
  7. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    0458170 View commit details
    Browse the repository at this point in the history
  8. Update Data.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    4e44149 View commit details
    Browse the repository at this point in the history
  9. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    b301023 View commit details
    Browse the repository at this point in the history
  10. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    dd94d93 View commit details
    Browse the repository at this point in the history
  11. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    d2d5f9c View commit details
    Browse the repository at this point in the history
  12. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    93ca111 View commit details
    Browse the repository at this point in the history
  13. Update callbacks.py

    import traceback
    
    from Data import Data
    from pyrogram import Client
    from pyrogram.types import CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton
    from StringSessionBot.generate import generate_session
    
    
    # Callbacks
    @Client.on_callback_query()
    async def _callbacks(bot: Client, callback_query: CallbackQuery):
        user = await bot.get_me()
        # user_id = callback_query.from_user.id
        mention = user["mention"]
        query = callback_query.data.lower()
        if query.startswith("home"):
            if query == 'home':
                chat_id = callback_query.from_user.id
                message_id = callback_query.message.message_id
                await bot.edit_message_text(
                    chat_id=chat_id,
                    message_id=message_id,
                    text=Data.START.format(callback_query.from_user.mention, mention),
                    reply_markup=InlineKeyboardMarkup(Data.buttons),
                )
        elif query == "about":
            chat_id = callback_query.from_user.id
            message_id = callback_query.message.message_id
            await bot.edit_message_text(
                chat_id=chat_id,
                message_id=message_id,
                text=Data.ABOUT,
                disable_web_page_preview=True,
                reply_markup=InlineKeyboardMarkup(Data.home_buttons),
            )
        elif query == "help":
            chat_id = callback_query.from_user.id
            message_id = callback_query.message.message_id
            await bot.edit_message_text(
                chat_id=chat_id,
                message_id=message_id,
                text="**Here's How to use me**\n" + Data.HELP,
                disable_web_page_preview=True,
                reply_markup=InlineKeyboardMarkup(Data.home_buttons),
            )
        elif query == "generate":
            await callback_query.message.reply(
                "Please choose the python library you want to generate string session for",
                reply_markup=InlineKeyboardMarkup([[
                    InlineKeyboardButton("Pyrogram", callback_data="pyrogram"),
                    InlineKeyboardButton("Telethon", callback_data="telethon")
                ]])
            )
        elif query in ["pyrogram", "telethon"]:
            await callback_query.answer()
            try:
                if query == "pyrogram":
                    await generate_session(bot, callback_query.message)
                else:
                    await generate_session(bot, callback_query.message, telethon=True)
            except Exception as e:
                print(traceback.format_exc())
                print(e)
                await callback_query.message.reply(ERROR_MESSAGE.format(str(e)))
    
    
    ERROR_MESSAGE = "Oops! An exception occurred! \n\n**Error** : {} " \
                "\n\nPlease visit @StarkBotsChat if this message doesn't contain any " \
                "sensitive information and you if want to report this as " \
                "this error message is not being logged by us!"
    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    5e0c142 View commit details
    Browse the repository at this point in the history
  14. Update generator.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    fe3fdb9 View commit details
    Browse the repository at this point in the history
  15. Update generator.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    ddff786 View commit details
    Browse the repository at this point in the history
  16. Update callbacks.py

    Frds-ubot authored Apr 9, 2022
    Configuration menu
    Copy the full SHA
    97283b3 View commit details
    Browse the repository at this point in the history
Loading