genstava789 commited on
Commit ·
8f7a0ec
1
Parent(s): 8db20f1
update
Browse files
.env
CHANGED
|
@@ -3,5 +3,4 @@ NGROK_API_KEY="2x3ltEFcOJ6RCUDpFlOCRXgPqyv_74ZAqg6Bohdep34oyA8qh"
|
|
| 3 |
API_ID = 2589472
|
| 4 |
API_HASH = "5243628014db9798d6775b330e542602"
|
| 5 |
BOT_TOKEN = "6660507029:AAEn5qC51Ftuv7rWJNGHaOtEjAhjzYB4Nio"
|
| 6 |
-
|
| 7 |
-
|
|
|
|
| 3 |
API_ID = 2589472
|
| 4 |
API_HASH = "5243628014db9798d6775b330e542602"
|
| 5 |
BOT_TOKEN = "6660507029:AAEn5qC51Ftuv7rWJNGHaOtEjAhjzYB4Nio"
|
| 6 |
+
DEV_ID = "1487943213"
|
|
|
bot.py
CHANGED
|
@@ -25,6 +25,7 @@ load_dotenv()
|
|
| 25 |
api_id = os.getenv("API_ID")
|
| 26 |
api_hash = os.getenv("API_HASH")
|
| 27 |
bot_token = os.getenv("BOT_TOKEN")
|
|
|
|
| 28 |
default_api_key = os.getenv("NGROK_API_KEY")
|
| 29 |
|
| 30 |
bot = Client("my_bot", api_id=api_id, api_hash=api_hash, bot_token=bot_token)
|
|
@@ -318,7 +319,7 @@ async def threads(client: Client, message: Message):
|
|
| 318 |
await message.reply('Failed to download media, make sure your link is valid!')
|
| 319 |
except Exception as e:
|
| 320 |
logging.error(f"An error occurred: {e}")
|
| 321 |
-
await client.send_message(
|
| 322 |
await message.reply('An unexpected error occurred. Please try again later.')
|
| 323 |
finally:
|
| 324 |
await load.delete()
|
|
|
|
| 25 |
api_id = os.getenv("API_ID")
|
| 26 |
api_hash = os.getenv("API_HASH")
|
| 27 |
bot_token = os.getenv("BOT_TOKEN")
|
| 28 |
+
dev_id = os.getenv("DEV_ID")
|
| 29 |
default_api_key = os.getenv("NGROK_API_KEY")
|
| 30 |
|
| 31 |
bot = Client("my_bot", api_id=api_id, api_hash=api_hash, bot_token=bot_token)
|
|
|
|
| 319 |
await message.reply('Failed to download media, make sure your link is valid!')
|
| 320 |
except Exception as e:
|
| 321 |
logging.error(f"An error occurred: {e}")
|
| 322 |
+
await client.send_message(dev_id, f'[ ERROR MESSAGE ]\n\n• Username: @{message.from_user.username}\n• Url: {url}\n\n{str(e)}')
|
| 323 |
await message.reply('An unexpected error occurred. Please try again later.')
|
| 324 |
finally:
|
| 325 |
await load.delete()
|