/r/TelegramBots

Photograph via snooOG
  • Share your Telegram bots and discover bots other people have made.
  • About

    Share your Telegram bots and discover bots other people have made. You can also ask development questions.

    Telegram is a messaging app with a focus on speed and security, it’s super fast, simple and free.

    Rules

    Please follow the following rules and the reddiquette for posting links and comments:

    1. Please set a linkflair when posting to this subreddit. (click the flair button after posting)

    2. Do not post bots that offend people or other bots (they have feelings!)

    3. Do not post direct links to your bots! Make a text post, containing a description and the link.

    4. Mark NSFW bots in the title.

    5. When asking a question, be clear and give context. Vague questions yield vague answers.

    6. Links with a referral identifier are not permitted.

    7. Provide a usage example of the bot that let's people understand what information is needed in order to use the bot.

    Wiki

    Collection of API Wrappers:

    https://www.reddit.com/r/TelegramBots/wiki/index

    Collection threads

    Related subreddits

    /r/TelegramBots

    41,870 Subscribers

    1

    Can' watch ads within game bots.

    Why can´t i watch ads within bots or channels. There are certain tasks within game bots or channels that reward you by watching ads. But for the last 4 days i haven´t been able to watch any ads, i always get a message that there no ads available to me or that aren´t available ads to watch. Am i being block in some way?? This happens in all devices (PC web browser, and 2 smartphones).

    0 Comments
    2024/12/02
    12:34 UTC

    1

    Is there a bot that pulls data only with the full name and the first 6 digits of the CPF?

    I was hit today and I would like to open a report or take action, because I lost money that wasn't even mine and I can't afford to replace it. Is there a bot to pull data from the person, so that I can take some action about it?

    1 Comment
    2024/12/01
    21:29 UTC

    2

    Looking for a bot to automatically resends messages from a channel to a theme in a group

    So, here is the situation. A Telegram channel gives up some information about a game. I have a telegram gruop.

    I need to know it there is a bot that resensd messages with the game updates to a certain channel of a group

    2 Comments
    2024/12/01
    20:15 UTC

    1

    Looking to Buy Finance-Related Telegram Groups with Income

    I’m interested in purchasing finance-focused Telegram groups that generate income through member subscriptions, ads, or other monetization methods. If you’re considering selling your group or know where I can find such opportunities, please feel free to reach out!

    I’m particularly looking for groups with engaged members and stable revenue. Let’s chat!

    2 Comments
    2024/12/01
    17:03 UTC

    1

    How to create public channel without letting my users join the linked group?

    Hey everyone. I stumbled upon a problem that gives me a really hard time.
    I have now an existing channel and linked to a private group where I do my backend work such as configuring bots. What should I do to prevent from joining my group?

    I saw a channel (BTC) it has a channel and when I click the join group, it did create a group but stay on the channel but with chat option (not comment section)

    Badly needed help. Do I need to use a bot for this problem?

    1 Comment
    2024/12/01
    13:29 UTC

    1

    Urgent enquiry

    Please how can I push my way through to send a video to a group messages are not are allowed?

    1 Comment
    2024/12/01
    06:57 UTC

    1

    I need a bot that look for channels

    1 Comment
    2024/12/01
    04:32 UTC

    0

    Best deepfake bot

    https://braundress.me/entry?start=n5jLjC8p

    Tons of options when it comes to styles/poses

    1 Comment
    2024/12/01
    00:21 UTC

    1

    I need a bot that can download playlists from spotify

    So as the title says the reason why I am asking is because musicshunterbot is down for maintenance for the past week or so and I need an alternative

    0 Comments
    2024/11/30
    19:53 UTC

    1 Comment
    2024/11/30
    18:52 UTC

    1

    Save and download private circle messages in Telegram

    “Hello everyone, how are you doing? I have a question. How can I download private messages in the form of stickers in Telegram? These messages are in a closed Telegram group.” My Telegram -@pickmepro47

    1 Comment
    2024/11/30
    15:32 UTC

    1

    Need Help with my Bot

    So I made a Bot to download files that I forward to it on my Jellyfin server. Telegram only let the Bot to download files only upto 50mb. Is there anyway I can make the bots download huge files? (1-4gb).

    Here's how it works currently:

    Forward File to Bot>>>Bot downloads it to movies directory>>> Jellyfin picks up the file

    5 Comments
    2024/11/30
    09:00 UTC

    2

    Looking for a telegram bot that tracks and notifies also SELL ORDERS. Tg is filled with buybots but I'm yet to find a sellbot for Solana tokens

    Hey!

    Been setting up different buybots, but never se the option to setup sell bots, obviously they exist to create and keep up hype and tracking. Is there any bot that allows me to track sells also? Any other app outside telegram is usually slow with tracking.

    0 Comments
    2024/11/29
    07:53 UTC

    0

    getting the same error I have give all necessary permission to bot but still

    import logging
    import requests
    import asyncio
    from telegram.error import TelegramError
    from typing import Final
    from telegram import Update
    from telegram import InlineKeyboardButton, InlineKeyboardMarkup, InputFile
    from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes,CallbackQueryHandler,Updater,CallbackContext, CallbackContext, CallbackQueryHandler
    logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',level=logging.INFO)
    logger = logging.getLogger(__name__)
    Token: Final = 'token number'
    url = f'https://api.telegram.org/bot{Token}/deleteWebhook'
    response = requests.get(url)
    print(response.json())
    GROUP_LINK = 'https://t.me/internalgrp'  # Replace with your group's link
    TARGET_GROUP_CHAT_ID = GROUP_LINK.split('/')[-1] # Extract username from the link
    # If the group is private, prefix with -100
    TARGET_GROUP_CHAT_ID = f"-100{TARGET_GROUP_CHAT_ID}"  # Only if necessary
    
    print(TARGET_GROUP_CHAT_ID)  # Output the group chat ID
    BotUserName: Final = '@CaesiumAirdopBot'
    
    # Commands
    async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
        print("Starting command...")
        chat_id = update.effective_chat.id
        logger.info(f"Chat ID: {chat_id}")  # Log the chat ID
        video_url = 'https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4'  # Sample video URL
        caption = ("Welcome to participate in our airdrop! 🎉\n"
                   "\n⬇️ <b>Please complete the tasks below to earn $50 worth of $CSM tokens.</b>\n"
                   "\nℹ️ <b>About Caesium ($CSM):</b>\n"
                   "Caesium ($CSM) is a digital cryptocurrency built on the Binance Smart Chain. It offers fast, secure, and low-fee transactions and is designed to enable decentralised finance (DeFi) solutions and provide a seamless wallet experience.\n"
                   "\nThe airdrop will end on [insert date] and every valid participant will be rewarded.\n"
                   "🗒 <b>Our Airdrop Rules:</b>\n"
                   "🔘 Follow our Telegram Channel\n"
                   "🔘 Join our Telegram Group\n"
                   "🔘 Join the Alpha Returns Telegram Group: Alphareturns\n"
                   "🔘 Follow us on Twitter\n"
                   "🔘 Download the Caesium Wallet and complete KYC verification: Caesium Wallet\n"
                   "🔘 Submit your Caesium Wallet Address.\n"
                   "🔘 Refer your friends and submit your sponsor code\n"
                   "\n<b>Additional Tasks to Earn more</b>\n"
                   "\n 🔘 Download Alpha Returns from the App Store or Google Play:\n"
                   "\n    • <a href='https://apps.apple.com/in/app/alpha-returns/id6479646239'>Apple Store</a>\n"
                   "    • <a href='https://play.google.com/store/apps/details?id=com.caesiumlab.alphareturns&hl=en_IN'>Google Play</a>\n"
                   "\nIf you have any questions, please ask in our Telegram Group."
        )
        
        # Create keyboard buttons
        keyboard = [[InlineKeyboardButton("Join AirDrop", callback_data='join_airdrop')]]  # Callback button
        reply_markup = InlineKeyboardMarkup(keyboard)  # Create InlineKeyboardMarkup
    
        # Send the message with buttons
        await context.bot.send_video(chat_id, video=video_url, caption=caption, parse_mode='HTML', reply_markup=reply_markup)
     
     #Define the tasks
    TASKS = [
        f"Task 1: Thank you for joining the AirDrop! 🎉\nPlease follow the instructions to complete your participation.\n\nPlease join the target group to complete the task: {GROUP_LINK}",
        "Task 2: Follow us on Twitter: Caesium Twitter, retweet the pinned post & tag 3 friends\n\nThen submit your Twitter username:\nExample: @username",
        f"Task 3: Download the <b>Caesium Wallet complete the process of sign-up</b>, and complete KYC verification:\n\nSubmit your Caesium Wallet Address to confirm your participation.\n\n   • [Caesium Wallet](https://caesiumwallet.app)",
        "Task 4:Complete your KYC to the Caesium Wallet to confirm your participation.\n\n **Submit the screenshot**",
        "Task5:Refer your friends and submit your sponsor code.\nOpen your Caesium Wallet, go to the 'Refer' section, copy your unique invitation link, and share it with 5 of your friends to invite them to join!"
    ]
    # Dictionary to track user task progress
    user_tasks = {}
       
    #tasks
    async def join_airdrop(update: Update, context: CallbackContext):
        user_id = update.effective_chat.id
        user_tasks[user_id] = 0  # Start at the first task
        await send_task(update, context)
    
    async def send_task(update: Update, context: CallbackContext):
        user_id = update.effective_chat.id
        task_index = user_tasks[user_id]
    
        if task_index < len(TASKS):
            task_text = TASKS[task_index]
            keyboard = [
                [InlineKeyboardButton("✅Done", callback_data='done'),
                 InlineKeyboardButton("❌Cancel", callback_data='cancel')],
                
            ]
            reply_markup = InlineKeyboardMarkup(keyboard)
            await context.bot.send_message(chat_id=user_id, text=task_text, parse_mode='HTML',reply_markup=reply_markup)
        else:
            await context.bot.send_message(chat_id=user_id, text="**Congratulations!** 🎉 Once your KYC is approved, $50 worth of $CSM will be credited to your wallet. 💸",)
    
    async def done_task(update: Update, context: CallbackContext):
        user_id = update.effective_chat.id
    
        # Check if the user is in the user_tasks dictionary
        if user_id not in user_tasks:
            user_tasks[user_id] = 1  # Initialize the user's task index if not present
        task_index = user_tasks[user_id]
        if task_index == 2:  # Task 2: Twitter username submission
            await context.bot.send_message(chat_id=user_id, text="Please submit your Twitter username:")
            return
    
        if task_index == 3:  # Task 3: Wallet address submission
            await context.bot.send_message(chat_id=user_id, text="Please submit your Caesium Wallet Address:")
            return
    
        if task_index == 4:  # Task 4: KYC screenshot submission
            await context.bot.send_message(chat_id=user_id, text="Please submit your KYC verification screenshot:")
            return
        if task_index == 5:  # Task 5: Sponsor code submission
            await context.bot.send_message(chat_id=user_id, text="Please submit your sponsor code:")
            return
    
        # Check if the user is a member of the target group
        await check_membership(update, context)
    
    
    async def check_membership(update: Update, context: CallbackContext):
        user_id = update.effective_chat.id
        logger.info(f"Checking membership for user_id: {user_id} in group: {TARGET_GROUP_CHAT_ID}")
        
        try:
            member = await context.bot.get_chat_member(TARGET_GROUP_CHAT_ID, user_id)
            logger.info(f"Member status: {member.status}")
            
            if member.status in ['member', 'administrator', 'creator']:
                # User is a member, proceed to the next task
                await done_task_proceed(update, context)
            else:
                # User is not a member, remind them to join
                await context.bot.send_message(chat_id=user_id, text="You are not a member of the group. Please join the group to proceed.")
                # Resend the task until the user joins
                context.job_queue.run_once(remind_user, 1, data=user_id)  # Use 'data' instead of 'context'
    
        except TelegramError as e:
            logger.error(f"Error checking membership: {e}")
            if "chat not found" in str(e).lower():
                await context.bot.send_message(chat_id=user_id, text="You are not a member of the group. Please join the group to proceed.")
                # Resend the task until the user joins
                context.job_queue.run_once(remind_user, 1, data=user_id)  # Use 'data' instead of 'context'
            else:
                await context.bot.send_message(chat_id=user_id, text=f"An error occurred: {e}")
                  
        
    async def done_task_proceed(update: Update, context: CallbackContext):
        user_id = context.job.data
        task_index = user_tasks[user_id]
    
        if task_index < len(TASKS) - 1:  # Check if there are more tasks
            user_tasks[user_id] += 1  # Increment the task index
            await send_task(update, context)  # Send the next task
        else:
            await context.bot.send_message(chat_id=user_id, text="**Congratulations!** 🎉 Once your KYC is approved, $50 worth of $CSM will be credited to your wallet. 💸")
    
    async def remind_user(context: CallbackContext):
        user_id = context.job.data  # Use 'data' to access the user_id
        keyboard = [
            [InlineKeyboardButton("Join Group", url=GROUP_LINK)],
            [InlineKeyboardButton("Done", callback_data='done')]
        ]
        reply_markup = InlineKeyboardMarkup(keyboard)
        await context.bot.send_message(chat_id=user_id, text=f"Please join the target group: {GROUP_LINK}", reply_markup=reply_markup)
       
                   
    async def cancel_task(update: Update, context: CallbackContext):
        user_id = update.effective_chat.id
        user_tasks[user_id] = 0  # Reset to the first task
        await send_task(update, context)
        
    async def help_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
        keyboard = [
            [InlineKeyboardButton("Token value", callback_data='tokenvalue')],
            [InlineKeyboardButton("About", url='https://caesiumlab.com/blogs/unveils-a-visionary-2024-after-a-pivotal-caesium-crypto-stories-shaped-2023')]
        ]
        reply_markup = InlineKeyboardMarkup(keyboard)
        await context.bot.send_message(chat_id=update.effective_chat.id, text='I am Alpha! How can I help you?', reply_markup=reply_markup)
       
    #Responses
       
    def handle_response(text: str) -> str:
        processed: str = text.lower()
        if 'how are you' in processed:
            return 'I am good!'
        return 'I do not understand what you wrote..'
    
    
            
    async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
        user_id = update.effective_chat.id
        message_type: str = update.message.chat.type
        text: str = update.message.text
        print(f'User({update.message.chat.id}) in {message_type}: "{text}"') #debugging
        if 'hello' in text.lower():
            print("returning to start command")
            await start_command(update, context)
        elif user_id in user_tasks:
            task_index = user_tasks[user_id]
    
            if task_index == 2:  # Twitter username submission
                # Process Twitter username
                user_tasks[user_id] += 1  # Move to the next task
                await context.bot.send_message(chat_id=user_id, text=f"Twitter username '{text}' received. Now, proceed to the next task.")
                await send_task(update, context)
                return
    
            if task_index == 3:  # Wallet address submission
                # Process wallet address
                user_tasks[user_id] += 1  # Move to the next task
                await context.bot.send_message(chat_id=user_id, text=f"Wallet address '{text}' received. Now, proceed to the next task.")
                await send_task(update, context)
                return
    
            if task_index == 4:  # KYC screenshot submission
                # Process KYC screenshot (assuming it's a file)
                if update.message.photo:
                    user_tasks[user_id] += 1  # Move to the next task
                    await context.bot.send_message(chat_id=user_id, text="KYC screenshot received. Now, proceed to the next task.")
                    await send_task(update, context)
                    return
    
            if task_index == 5:  # Sponsor code submission
                # Process sponsor code
                user_tasks[user_id] += 1  # Move to the next task
                await context.bot.send_message(chat_id=user_id, text=f"Sponsor code '{text}' received. Thank you for referring your friends!")
                await send_task(update, context)
                return
        else:
         response: str = handle_response(text)
         print('Bot:', response)
         await update.message.reply_text(response)
        
    async def error(update: Update, context: ContextTypes.DEFAULT_TYPE):
        print(f'Update {update} caused error {context.error}')  
        
    async def button_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
        query = update.callback_query
        await query.answer()  # Acknowledge the button press
    
        # Prepare the new message based on the button clicked
        if query.data == 'tokenvalue':
            new_message = "The present Caesium token value is 11$"
            await context.bot.send_message(chat_id=query.message.chat.id, text=new_message)
        elif query.data == 'join_airdrop':
            await join_airdrop(update, context)
        elif query.data == 'done':
            await done_task(update, context)
        elif query.data == 'cancel':
            await cancel_task(update, context)
        
        
         #Send a new message instead of editing the original one
          
                
    if __name__ == '__main__':
        print('Starting')
        app= Application.builder().token(Token).build()
        app.add_handler(CommandHandler('start', start_command))
        app.add_handler(CommandHandler('help', help_command))
        app.add_handler(CallbackQueryHandler(button_handler))
        app.add_handler(CommandHandler('check_membership', check_membership))
         #message
        app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message))  # Handle only non-command text messages
        #error
        app.add_error_handler(error)
        print('polling')
        app.run_polling()
    
    
    
    error :
    2024-11-28 18:50:40,306 - __main__ - INFO - Checking membership for user_id: user id in group: groupid
    2024-11-28 18:50:40,707 - httpx - INFO - HTTP Request: POST https://api.telegram.org/bot7591235439:AAHGOmxO5QoCm-UwJdLtPEaciqAWBHdHBTA/getChatMember "HTTP/1.1 400 Bad Request"
    2024-11-28 18:50:40,709 - __main__ - ERROR - Error checking membership: Chat not found
    2024-11-28 18:50:41,093 - httpx - INFO - HTTP Request: POST https://api.telegram.org/bot7591235439:AAHGOmxO5QoCm-UwJdLtPEaciqAWBHdHBTA/sendMessage "HTTP/1.1 200 OK"
    2024-11-28 18:50:41,101 - apscheduler.scheduler - INFO - Added job "remind_user" to job store "default"
    2024-11-28 18:50:42,107 - apscheduler.scheduler - INFO - Removed job a9150a75098643b0849911dd030c6ed2
    2024-11-28 18:50:42,109 - apscheduler.executors.default - INFO - Running job "remind_user (trigger: date[2024-11-28 13:20:42 UTC], next run at: 2024-11-28 13:20:42 UTC)" (scheduled at 2024-11-28 13:20:42.097511+00:00)
    2024-11-28 18:50:42,486 - httpx - INFO - HTTP Request: POST https://api.telegram.org/bot7591235439:AAHGOmxO5QoCm-UwJdLtPEaciqAWBHdHBTA/sendMessage "HTTP/1.1 200 OK"
    2024-11-28 18:50:42,489 - apscheduler.executors.default - INFO - Job "remind_user (trigger: date[2024-11-28 13:20:42 UTC], next run at: 2024-11-28 13:20:42 UTC)" executed successfully
     how can i reslove the issues any suggestion?
    4 Comments
    2024/11/28
    13:29 UTC

    1

    How to import on Telegram previously esporre chats

    Hello, i rally need to import on Telegram a few chats i have previously exported from it (both in JSON and HTML) and possibile includono photos/videos/audio exc... Pls can you help me....?

    0 Comments
    2024/11/28
    00:23 UTC

    0

    Locating the user or gather relevant info about the user (Knowing Telegram ID Only)

    Hi everyone,

    I recently transferred money to someone unknown in Seoul, Korea, whom contacted me through Telegram. Unfortunately, I only have their Telegram ID. I’m trying to understand if there’s anything else I can do.

    Has anyone dealt with a similar situation or knows of any effective ways to track down using just their Telegram ID?

    Any tips or guidance would be greatly appreciated

    4 Comments
    2024/11/27
    01:43 UTC

    0

    Thoughts on this mod bot?

    let met know what else i can add.

    Bot Overview

    The bot is designed for group moderation and enhanced interaction. Its key features include welcoming new members, enforcing rules with CAPTCHA, managing bad words, and offering useful group insights.

    Functions

    1. Welcoming New Members:
      • Automatically handles new members with a customizable CAPTCHA verification process.
      • Mutes users until they successfully complete the CAPTCHA.
      • Sends personalized welcome messages.
    2. Moderation Tools:
      • Automatically deletes messages with bad words or links (if enabled).
      • Manages a list of banned words for the group.
      • Allows banning users based on join date or username.
      • Supports configurable interaction levels.
    3. Group Activity Insights:
      • Displays a leaderboard of the most active members.
      • Generates daily, weekly, or monthly activity summaries, including warnings, bans, and new users.
    4. Interactive Commands:
      • Fun features like /dice to roll a random number.
    5. Administrator Commands:
      • Configure bot behavior (e.g., interaction level, link deletion).
      • Manage banned words and CAPTCHA settings.

    Key Commands

    1. /start – Introduces the bot and provides a button to add it to a group.
    2. /help – Displays a list of commands and their descriptions.
    3. /dice – Rolls a random number between 1 and 200,000.
    4. /leaderboard – Shows the top 3 active users in the group.
    5. /summary [daily|weekly|monthly] – Generates a group activity summary.
    6. /addbadword [word] – Adds a word to the banned words list.
    7. /deletebadword [word] – Removes a word from the banned words list.
    8. /badwords – Displays the list of currently banned words.
    9. /link [on|off] – Toggles automatic link deletion.
    10. /setinteraction [level] – Sets the bot's interaction level (0–3) this is connected to chatgpt.
    11. /ban - you can ban members by date,
    7 Comments
    2024/11/25
    17:21 UTC

    1

    Telegram Group adverting ?

    I’d like to ask the community for some advice. I run a Telegram group where I support refugees who have fled from war. I’m currently considering enabling the “forward content” feature, so that members can share my carefully crafted posts in other groups as well. I’ve received this suggestion multiple times already.

    Do you think this could also help me attract new group members? I would be very grateful for any advice, or if you have other suggestions for how I could reach and support more people. Thank you so much in advance!

    2 Comments
    2024/11/25
    14:16 UTC

    2

    can someone teach how to make nzb bot to mirror nzb file?

    0 Comments
    2024/11/25
    12:17 UTC

    1

    Sending masturbation to every guy that upvotes 🤤 (Yes i actually send try me) Telegram:@cutelove345

    2 Comments
    2024/11/25
    01:56 UTC

    1

    How to make bot robust to handle 500k daily users

    I need my bot to be responsive and robust to handle the load of many users.

    2 Comments
    2024/11/24
    22:11 UTC

    3

    What's on your plate? (tg bot)

    Hello, everyone.

    I created this bot while learning how to connect to ChatGPT’s models via API.

    Even though about half a year has passed since I developed it, it is still a pretty interesting tool, even for me.

    Here, I just want to share this tool, and hopefully, it will be useful for someone else as well.

    The main purpose of this bot is to recognize the food in a photo and provide information about the dish's nutritional value, including calories, fats, and carbohydrates.

    I welcome any thoughts or ideas!

    https://reddit.com/link/1gz1s1g/video/dhe05o2wix2e1/player

    3 Comments
    2024/11/24
    21:16 UTC

    1

    Do bots expire?

    I’m after a nice clean username for my telegram bot and all relative and clean usernames are taken my seemingly dormant bots that have probably just scraped my ID for pig butchering scams.

    Anyone have any ideas?

    10 Comments
    2024/11/24
    14:00 UTC

    1

    need help to create a bot similar to @howgaybot

    so i wanted to make a bot like @howgaybot that just generates a random percentage and sends it as a text message to user.
    but i have some issues.

    https://preview.redd.it/eizx1lmdto2e1.png?width=322&format=png&auto=webp&s=6671bd38c7fba9a476487f25e0ef2bc669df5e8a

    i can't create a panle like this that can pop up every time you type it's ID
    is there any open source code for this function?

    3 Comments
    2024/11/23
    17:38 UTC

    0

    Earn $ with this Browser Extension

    I just started earning on @nodepay_ai 💵

    Sign Up and Download the User Extension and let it run in the background simple!

    Don't forget to activate your account 🤑 https://app.nodepay.ai/register?ref=Ragbxyh1dOEWKmu

    0 Comments
    2024/11/23
    10:05 UTC

    1

    i need a bot that chooses a random member of the group basically like contest/lottery please (579 members).

    1 Comment
    2024/11/23
    06:49 UTC

    2

    I wanna build a raiding bot, but need some paid help. Can people with a lot of experience reach out in my DM’s

    2 Comments
    2024/11/23
    05:58 UTC

    0

    Bots for downloading Tv Series/movies

    0 Comments
    2024/11/22
    15:04 UTC

    Back To Top