Script Wraper
Open in Telegram
Download All New Latest Theme, Plugins, Scripts & Codes Only On "Script Wrap" Stay With "Script Wrap" & Get 👇 👉Premium Script 👉Premium Theme 👉Premium Plugins 👉Premium Codes
Show more794
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
➡️ Telegram Python Bot Tutorial
✅ Send Inline Keyboard In Bot -:
import telebot
from telebot import types
bot = telebot.TeleBot("bot_token")
@bot.message_handler(commands=['start'])
def start(message):
keyboard = types.InlineKeyboardMarkup()
button1 = types.InlineKeyboardButton("Button 1", callback_data='button1')
button2 = types.InlineKeyboardButton("Button 2", callback_data='button2')
keyboard.add(button1, button2)
bot.send_message(message.chat.id, 'Choose an option:', reply_markup=keyboard)
@bot.callback_query_handler(func=lambda call: True)
def callback_query(call):
if call.data == 'button1':
bot.send_message(call.message.chat.id, 'You pressed Button 1')
elif call.data == 'button2':
bot.send_message(call.message.chat.id, 'You pressed Button 2')
bot.polling()
🔰 Join - @KaranCoder || @TGBotsCode➡️ Telegram Python Bot Tutorial
✅ Send Keyboard In Bot -:
import telebot
from telebot import types
# paste here bot token which you got from @botfather
bot_token = "bot_token"
bot = telebot.TeleBot(bot_token)
# send Keyboard
@bot.message_handler(commands=['start'])
def send_keyboard(message):
keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
button1 = types.KeyboardButton('Button 1')
button2 = types.KeyboardButton('Button 2')
keyboard.row(button1)
keyboard.row(button2)
bot.send_message(message.chat.id,"Choose Keyboard:",reply_markup=keyboard)
@bot.message_handler()
def message_handler(message):
if message.text == 'Button 1':
bot.send_message(message.chat.id,'button1 was pressed!')
if message.text == 'Button 2':
bot.send_message(message.chat.id,'button2 was pressed!')
# this for start your bot
bot.polling()
🔰 Join - @KaranCoder || @TGBotsCode➡️ Telegram Python Bot Tutorial
⁉️ Installation -:
pip install pyTelegramBotAPI
✅ Simple Start Command Using Python Bot -:
import telebot
# bot token from @botfather
bot = telebot.TeleBot("your_bot_token")
# /start command for your bot
@bot.message_handler(commands=['start'])
def handle_start(message):
bot.send_message(message.chat.id, "Hello, welcome to the bot!")
# Start the bot
bot.polling()
🔰 Join - @KaranCoder || @TGBotsCode👉 Python WhatsApp DM Bot Code Here 👈
➡️ Code -
import telebot
import re
# Replace YOUR_TOKEN_HERE with your actual bot token
bot = telebot.TeleBot('Your Token Here')
@bot.message_handler(commands=['start'])
def send_welcome(message):
chat_id = message.chat.id
bot.send_message(chat_id, "<b>Welcome to the WhatsApp DM Bot! Please send me a phone number with a country code to get a link to their WhatsApp DM.</b>\n\n<b>Please Support Us - @KaranCoder || @TGBotsCode</b>", parse_mode="HTML")
@bot.message_handler(func=lambda message: True)
def send_wa_link(message):
chat_id = message.chat.id
if message.text.startswith('/start'):
bot.send_message(
chat_id, "<b>Welcome to the WhatsApp DM Bot! Please send me a phone number with a country code to get a link to their WhatsApp DM.</b>", parse_mode="HTML")
elif re.match('^(\+?\d{1,3}[- ]?)?\d{10}$', message.text):
phone_number = message.text
wa_link = f"https://wa.me/{phone_number}"
inline_keyboard = telebot.types.InlineKeyboardMarkup()
button = telebot.types.InlineKeyboardButton(
text="Open In WhatsApp", url=wa_link)
inline_keyboard.add(button)
image_url="https://i.ibb.co/XVXn9Fr/dima-solomin-up-BKRm-HJr-CI-unsplash.jpg"
caption="<b>Here is your WhatsApp DM link:</b>"
bot.send_photo(chat_id, photo=image_url, caption=caption,
reply_markup=inline_keyboard,parse_mode="html")
else:
bot.send_message(
chat_id, "<b>Please send me a phone number with a country code.</b>",parse_mode="html")
bot.polling()
🙃 Share And Support Us - @KaranCoder || @TGBotsCodeHot combinations
#hotkeys
✅ Now you will remember exactly what these combinations do!
💻 Let's learn the computer together ⤵️
✅ Join - @KaranCoder
Live Coder Editor
File Link - https://t.me/KaranCoder/29
Join For More - @KaranCoder
Hello friends, on this channel, I will post templates, designs, ideas of good websites .
you stay with me on this channel.
❤️ Support - @KaranCoder
The Complete 2022 Web Development Bootcamp
Become a Full-Stack Web Developer with just ONE course. HTML, CSS, Javascript, Node, React, MongoDB, Web3 and DApps
By:- Angela Yu
Source-
https://www.udemy.com/course/the-complete-web-development-bootcamp/
🔗 Mega Drive Download Link :-
https://mega.nz/folder/ysJAkIZC#3PPsSvKyaO6HYRzgLKoWqw
@KaranCoder
▪️Share & Support us▪️
Want Tutorial On How To Use Battery Detect Code ?? And Tell On Which Device ?
