/r/TelegramBots
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.
Please follow the following rules and the reddiquette for posting links and comments:
Please set a linkflair when posting to this subreddit. (click the flair button after posting)
Do not post bots that offend people or other bots (they have feelings!)
Do not post direct links to your bots! Make a text post, containing a description and the link.
Mark NSFW bots in the title.
When asking a question, be clear and give context. Vague questions yield vague answers.
Links with a referral identifier are not permitted.
Provide a usage example of the bot that let's people understand what information is needed in order to use the bot.
Collection of API Wrappers:
https://www.reddit.com/r/TelegramBots/wiki/index
/r/TelegramBots
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).
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?
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
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!
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?
Please how can I push my way through to send a video to a group messages are not are allowed?
https://braundress.me/entry?start=n5jLjC8p
Tons of options when it comes to styles/poses
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
“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
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
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.
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?
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....?
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
let met know what else i can add.
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.
/dice
to roll a random number./start
– Introduces the bot and provides a button to add it to a group./help
– Displays a list of commands and their descriptions./dice
– Rolls a random number between 1 and 200,000./leaderboard
– Shows the top 3 active users in the group./summary [daily|weekly|monthly]
– Generates a group activity summary./addbadword [word]
– Adds a word to the banned words list./deletebadword [word]
– Removes a word from the banned words list./badwords
– Displays the list of currently banned words./link [on|off]
– Toggles automatic link deletion./setinteraction [level]
– Sets the bot's interaction level (0–3) this is connected to chatgpt.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!
I need my bot to be responsive and robust to handle the load of many users.
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!
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?
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.
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?
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