Skip to content

Commit

Permalink
Create Telegram bot
Browse files Browse the repository at this point in the history
Telegram extractor
  • Loading branch information
Arjun00000 authored Nov 7, 2024
1 parent 96816b3 commit aed7ec0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Telegram bot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler

TOKEN = 7901866660:AAFJ2Te56IAreu3nxnXKgRrQXNEKMF3CoSg #

logging.basicConfig(level=logging.INFO)

def save_restricted_content(update, context):
# Save content to file
file_id = update.message.document.file_id
file = context.bot.get_file(file_id)
file.download('restricted_content/')

def restrict_access(update, context):
# Restrict access to saved content
context.bot.send_message(chat_id=(link unavailable), text='Access restricted.')

def main():
updater = Updater(TOKEN, use_context=True)
dp = updater.dispatcher

dp.add_handler(CommandHandler('save', save_restricted_content))
dp.add_handler(CommandHandler('restrict', restrict_access))

updater.start_polling()
updater.idle()

if __name__ == '__main__':
main()

0 comments on commit aed7ec0

Please sign in to comment.