Advanced Coding
26.8K subscribers
42 photos
9 videos
18 files
57 links
Owner :- @MiddleDealer
Download Telegram
πŸ–Š File Rename Bot Code [ Python ]

import os
import telebot
bot = telebot.TeleBot("BOT_API_TOKEN")
user_new_names = {}
@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.reply_to(message, f"""<b>Welcome to the file renamer bot. Send me a file to rename it. By @kids_coder</b>""",parse_mode="HTML")
@bot.message_handler(content_types=['document'])
def handle_file(message):
file_name = message.document.file_name
file_id = message.document.file_id
file_info = bot.get_file(file_id)
downloaded_file = bot.download_file(file_info.file_path)
bot.send_message(message.chat.id, f"""<b>Current file name:</b> <code>{file_name}</code>\n<b>What should be the new name?</b>""",parse_mode="HTML")
user_chat_id = message.chat.id
user_new_names[user_chat_id] = (file_name, downloaded_file)
@bot.message_handler(func=lambda message: message.chat.id in user_new_names and user_new_names[message.chat.id] is not None)
def handle_new_name(message):
original_file_name, downloaded_file = user_new_names[message.chat.id]
new_name = message.text.strip()
renamed_file_name = "" + new_name
with open(renamed_file_name, 'wb') as renamed_file:
renamed_file.write(downloaded_file)
with open(renamed_file_name, 'rb') as renamed_file:
bot.send_document(message.chat.id, renamed_file)
del user_new_names[message.chat.id]
os.remove(renamed_file_name)
bot.polling()


πŸ‘¨β€πŸ’»Developer : @RushikeshLade1
Β© Published By :
@Kids_Coder

⚠️ Don't Share Without Mentioning
@Kids_Coder
πŸ‘9πŸ€”2❀1πŸ”₯1
Top Referral Code for TBC

topr = Bot.getData("topr")
if topr == None:
push = []
else:
push = topr

check_user = push.count(u)
if check_user > 0:
"""user_exist"""
else:
push.append(u)
Bot.saveData("topr", push)

Put in in startπŸ‘†

Command :- Top Inviters
user_ids = Bot.getData("topr") or []
user_data = []
for user_id in user_ids:
refcount = int(libs.Resources.anotherRes("invited_user", user=user_id).value())

user_data.append((user_id, refcount))

user_data.sort(key=lambda x: x[1], reverse=True)

m = "<b>βœ… ScoreBoard [#]</b> \n\n"
for i, (user_id, refcount) in enumerate(user_data[:7]):
username = bot.getChatMember(chat_id=user_id,user_id=user_id)
usernampe = username.user.first_name
usernamoe = username.user.username
msg = f"""<a href="https://t.me/{usernamoe}">{usernampe}</a>"""
censored_username = msg
m += f"<b>{i+1} ) {censored_username}</> : [<code>{refcount}</code>]\n\n"
m += """<i>πŸ“€ Invite More To Reach To Top Of The ScoreBoard ! </>"""
bot.replyText(u,m,disable_web_page_preview=True)


It take some loading & only show top 10πŸ‘
Developer :
@RushikeshLade1
Published At :
@kids_coder
πŸ‘9❀3πŸ€”2πŸ”₯1
πŸ–₯ Beginner Coding Tip πŸ–₯

✨ Tip: Start Small and Build Up ✨

When you're just starting out, it's easy to get overwhelmed by complex projects. Here's a simple strategy to keep you on track:

Begin with Small Projects:
Start with small, manageable projects. This could be something as simple as a basic calculator, a to-do list app, or a guessing game. Completing these small projects will help you build confidence and understand fundamental concepts.

Why This Works:
- Quick Wins: Finishing a small project gives you a sense of accomplishment and motivation.
- Focused Learning: You can concentrate on learning one concept at a time without getting overwhelmed.
- Foundation Building: These small projects lay the groundwork for tackling more complex projects in the future.

Remember, every expert was once a beginner. Take it one step at a time and enjoy the learning process. Happy coding! πŸš€
πŸ”₯2❀1πŸ‘1
πŸ–₯ Beginner Coding Tip πŸ–₯

✨ Tip: Understand the Basics of Algorithms and Data Structures ✨

Learning the basics of algorithms and data structures is crucial for becoming a proficient programmer. Here’s why:

Why It Matters:
- Efficiency: Knowing which data structure or algorithm to use can make your code run faster and use less memory.
- Problem-Solving: Many programming challenges can be broken down and solved more easily with the right algorithm or data structure.
- Job Interviews: Knowledge of algorithms and data structures is often tested in coding interviews for tech jobs.

Getting Started:
1. Arrays and Lists: Learn how to store and access data.
2. Loops and Conditionals: Understand how to iterate and make decisions in your code.
3. Sorting Algorithms: Study basic sorting methods like bubble sort, selection sort, and insertion sort.
4. Basic Data Structures: Get familiar with stacks, queues, and hash tables.

Practice:
- Coding Platforms: Use platforms like LeetCode, HackerRank, or Codecademy to practice problems.
- Consistent Practice: Spend a little time each day working on problems to reinforce your learning.

Remember, the more you practice, the better you'll get. Keep pushing forward and happy coding! πŸš€
πŸ‘4πŸ₯°1
πŸ–₯ Beginner Coding Tip πŸ–₯

✨ Tip: Comment Your Code ✨

Writing clear and understandable code is just as important as making it work. Here's why you should get into the habit of commenting your code:

Why Commenting is Important:
- Clarity: Comments help explain what your code does, making it easier to understand for yourself and others.
- Maintenance: When you come back to your code after some time, comments can remind you of your thought process.
- Collaboration: If you're working with others, comments can help your teammates understand your code quickly.

How to Comment Effectively:
1. Explain the Why: Use comments to explain why you're doing something, not just what you're doing.
2. Keep It Simple: Write clear and concise comments.
3. Use Descriptive Variable Names: This reduces the need for excessive comments.
4. Update Comments: Ensure your comments stay accurate as you modify your code.

Example:
# Calculate the area of a circle
def calculate_area(radius):
# Use the formula: area = Ο€ * r^2
pi = 3.14159
area = pi * (radius ** 2)
return area


Remember, good comments can make your code much more readable and maintainable. Happy coding! πŸš€
πŸ‘10❀1
πŸ“Έ IMGBB Image Uploader TBC Code

πŸš€ Command: /yourCommand

πŸ›  Code:
if options == None:
    bot.replyText(
        chat_id=u, text="<b>πŸ“Έ Send Image to Upload\n\nTo Cancel: /cancel</b>")
    Bot.handleNextCommand("/yourCommand")
else:
    if message.text == "/cancel":
        bot.replyText(chat_id=u, text="❌ *Process Cancelled*", parse_mode="markdown")
        raise ReturnCommand()
    if not message.photo:
        bot.replyText(chat_id=u,reply_to_message_id=message["message_id"],text= f"❗ <b>Invalid Image</b>")
        raise ReturnCommand()
    photo = message.photo[-1].file_id
    file_path = bot.getFile(photo).file_path
   
    key = "#imgbb_API_KEY"

    uimg = f"https://api.telegram.org/file/bot{Bot.info().token}/{file_path}"
    src = HTTP.get(f"https://api.imgbb.com/1/upload?key={key}&image={uimg}").json()
    img = src['data']['url']
    bot.sendChatAction(
    chat_id=message.chat.id,
    action="upload_photo")
    bot.replyText(chat_id=u, text=f"<b>β˜‘οΈ Image Uploaded Successfully\n\nπŸ”— URL: <code>{img}</></>")


πŸ”‘ Get API KEY - https://api.imgbb.com
πŸ‘7❀3πŸ”₯1
Subscribe to Astro Source on Youtube & Telegram
πŸ‘5πŸ€”3πŸ‘€2
Imgify Ai πŸ–ΌοΈ

This ai bot can generate images as you want, just you describe bot will design.

πŸ€– Bot: @ImgifyAiBot

πŸ“„ Simply text the bot for the image you want to generate. For example: "Cute Cat"

⚠️ This tool should be used only for fun, not for any illegal activity.


πŸ˜‰ Try it! I'm sure, you will definitely like it. Use it for fun.
πŸ‘6πŸ’‹3😁1
Buy me a Cup of coffee β˜•οΈβ­οΈ

UPI - rushikeshlade@fam

TRX - TMiScMpNBui96KaPpJYxYTivaXEJjgmvJ6

BNB - 0x80D6A140b191aE2F35DCdE63090d5d324dC7a7b7

LTC - ltc1q73v5d2tr62dv9jqkvtm4euvf2r3j6haq6rpk9s

Buy Me a Coffee makes supporting fun and easy.❀️
πŸ‘20😁7
import logging
from telegram import Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import ApplicationBuilder, CommandHandler, CallbackQueryHandler, ContextTypes
from collections import defaultdict

# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO
)
logger = logging.getLogger(__name__)

# Dictionary to store likes
likes = defaultdict(set)

# Define the start command handler
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
await update.message.reply_text('Hi! Use /post to send an inline message with a link and a like button to the channel.')

# Define the post command handler
async def post(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
keyboard = [
[InlineKeyboardButton("Visit Google", url='https://www.google.com')],
[InlineKeyboardButton("Like πŸ‘", callback_data='like')]
]
reply_markup = InlineKeyboardMarkup(keyboard)

await context.bot.send_message(
chat_id='@CHANNELUSERNAME', # Replace with your channel's username
text='Click the button below to visit Google or to like this post!',
reply_markup=reply_markup
)
await update.message.reply_text('Message sent to the channel.')

# Define the button callback handler
async def button(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
query = update.callback_query
user_id = query.from_user.id
chat_id = query.message.chat.id

if query.data == 'like':
if user_id in likes[chat_id]:
await query.answer(text="You've already liked this post.")
else:
likes[chat_id].add(user_id)
await query.answer(text="Thanks for liking!")
# Optionally, update the message text with the new number of likes
# This example does not include that part for simplicity
else:
await query.answer()

def main() -> None:
# Create the Application and pass it your bot's token.
application = ApplicationBuilder().token('YOURBOTTOKEN').build()

# on different commands - answer in Telegram
application.add_handler(CommandHandler("start", start))
application.add_handler(CommandHandler("post", post))

# on callback query - handle the like button click
application.add_handler(CallbackQueryHandler(button))

# Start the Bot
application.run_polling()

if __name__ == '__main__':
main()
πŸ‘18❀11😁5
The above python code is for telegram bot that post message with inline buttons on your telegram channelπŸ‘
πŸ‘9🐳4
Media is too big
VIEW IN TELEGRAM
😈 Do you want to hack your Friends Mobile?

πŸ›‘ Mobile + Number + Camera Fully Hack by just sending him spy url.

πŸ€– Hack Bot:
@CameraSpyHackBot
πŸ‘37❀‍πŸ”₯9😁8🀩5πŸŽ‰2❀1
Advanced Coding pinned Deleted message
TRX Api's

Generate Address:
https://tronscape.vercel.app/generateaddress

See Balance: https://tronscape.vercel.app/balance/<TRX_ADDRESS>

Send Trx: https://tronscape.vercel.app/send/<PRIVATE_KEY>/<FR OM_ADDRESS>/<TO_ADDRESS>/AMOUNT

See History: https://tronscape.vercel.app/transactions/<TRX_ADDRESS>

Provider : @kids_coder
πŸ‘6❀4😁4
if(request.data){
var message_id = request.message.message_id
var chat_id = request.message.chat.id

Api.deleteMessage({
chat_id : chat_id,
message_id : message_id
})

}
if (!user.first_name) {
var valid_name = user.last_name
} else {
var valid_name = user.first_name
}
let currency = Bot.getProperty("currency");

let refList = Libs.ReferralLib.getRefList()
let users = refList.getUsers()
if (users.length < 100000000) {
var count = users.length
} else {
var count = refList.count
}

var user_link = Libs.commonLib.getLinkFor(user)
var withdrawn = Bot.getProperty("totalWithdrawn")
withdrawn = parseFloat(withdrawn)
var wallet = User.getProperty("TRXwallet")
var userPayment = Libs.ResourcesLib.anotherChatRes("totalPayment", "global")
var balance = Libs.ResourcesLib.userRes("balance")
if (isNaN(message)) {

} else {
}
let wn=Bot.getProperty("mw")
if (message < wn) {
Bot.sendMessage("_πŸ‘‹ Minimum Withdraw "+wn+" "+currency+"_")
} else {
if (message > balance.value()) {
Bot.sendMessage(
"_πŸ‘‹ Maximum Withdraw " + balance.value().toFixed(6) + " "+currency+"_"
)
} else {

balance.add(-message)
userPayment.add(+message)
let api_key=Bot.getProperty("apik")

var amount = message*100000000 //= equivalent 0.00000001 BCH, TRX, LTC etc
//enter your email or address
User.setProperty("amount", message, "string")
//setup
HTTP.post({
url: "https://faucetpay.io/api/v1/send",
success: "/onWdSuc ",
body:
"api_key=" +
api_key +
"&amount=" +
amount +
"&to=" +
wallet +
"&currency=" +
currency +
"",
headers: {
"Content-type": "application/x-www-form-urlencoded",
Accept: "application/json"
}
})

}}


©️ Credit : @kids_coder & @RushikeshLade1
πŸ‘22❀3
Faucetpay Auto Withdrawal Code πŸ‘†
❀‍πŸ”₯6πŸ‘4
Good night! πŸŒ™

"Dream big, work hard, stay focused, and surround yourself with good people. Success is not the key to happiness. Happiness is the key to success."

Rest well and wake up ready to conquer your dreams!
πŸ‘20❀3😁1
"Good night!

Remember that every day is a new chance to grow, learn, and make your dreams a reality. Rest well tonight, for tomorrow holds endless possibilities." 🌟
❀15πŸ‘5😁4