⭐ Accept Star Payment In Bot
👀Command:
/pay
Api.sendInvoice({
chat_id: user.telegramid, //chat id to send invoice at
title: "Product",
//add a product name
description: "This is a Digital Product",
//add a description of your product here
payload: "payload",
//add a payload, which you want after successful of payment. for example order id...
currency: "XTR", //for telegram stars
provider_token: "", //empty string for telegram stars
//protect_content: true,
//uncomment if you don't want forwarding post
start_parameter: "star",
//if the invoice messgae is forwarded, in place of Pay button it will show a deep link to your bot with this parameter
prices: [
{
label: "test", //add a label
amount: 1 //Amount of Telegram Stars
}
],
reply_markup: {
inline_keyboard: [[{ text: "Buy for ⭐️ 1", pay: true }]]
//the first star emoji in text of pay button of keyboard will be converted to Telegram star icon
}
})
👍1🥰1💯1
Telgram Link Detector And Remover Bot 🎀
<?php
$token = "YOUR_BOTTOKEN";
$webhookURL = "YOUR_WEBHOOK_URL";
$apiURL = "https://api.telegram.org/bot$token/";
$response = file_get_contents($apiURL . "setWebhook?url=" . urlencode($webhookURL));
if ($response) {
echo "Webhook has been set!";
} else {
echo "Failed to set the webhook!";
}
$update = json_decode(file_get_contents("php://input"), true);
function containsMarkdownLink($message) {
$decoded_message = json_decode('"' . $message . '"');
return preg_match('/\[(.*?)\]\((.*?)\)/', $decoded_message);
}
function containsTextLinkEntity($update) {
$entities = $update["message"]["entities"] ?? [];
foreach ($entities as $entity) {
if ($entity["type"] === "text_link") {
return true;
}
}
return false;
}
if (isset($update["edited_message"])) {
$editedMessage = $update["edited_message"];
$chatID = $editedMessage["chat"]["id"];
$editedText = $editedMessage["text"];
if (
preg_match('/\b(?:https?:\/\/|www\.)\S+\b/i', $editedText) ||
containsMarkdownLink($editedText) ||
containsTextLinkEntity($editedMessage) ||
preg_match('/\b\w+\.(com|net|org|io|etc)\b|\b\w+\.\w+\b/i', $editedText) ||
strpos($editedText, '.') !== false
) {
file_get_contents($apiURL . "deleteMessage?chat_id=$chatID&message_id=" . $editedMessage["message_id"]);
if (isset($editedMessage["from"]["username"])) {
$username = $editedMessage["from"]["username"];
$adminID = YOUR_ADMIN_ID_HERE;//replace your redmi ID
if ($adminID) {
$messageToAdmin = "⚠️ <b>Alert!</b> @$username edited a message and added a link:\n$editedText";
file_get_contents($apiURL . "sendMessage?chat_id=$adminID&text=" . urlencode($messageToAdmin) . "&parse_mode=HTML");
}
}
}
} elseif (isset($update["message"])) {
$message = $update["message"]["text"];
$chatID = $update["message"]["chat"]["id"];
$username = $update["message"]["from"]["username"]; // Get the sender's username
$adminID = ADMIN ID;
$lowercaseMessage = strtolower($message);
if ($message == "/start") {
$welcomeMessage = "🌟 <b>Welcome to the bot!</b>\nTo prevent certain messages, please <b>make me an admin</b> in your channel.";
file_get_contents($apiURL . "sendMessage?chat_id=$chatID&text=" . urlencode($welcomeMessage) . "&parse_mode=HTML");
} else {
if (
strpos($message, '@') === 0 ||
strpos($lowercaseMessage, 't.me/') !== false ||
strpos($lowercaseMessage, 'telegram.me/') !== false ||
preg_match('/\b(?:https?:\/\/|www\.)\S+\b/i', $message) ||
containsMarkdownLink($message) ||
containsTextLinkEntity($update) ||
preg_match('/\b\w+\.(com|net|org|io|etc)\b|\b\w+\.\w+\b/i', $message) ||
strpos($message, '.') !== false
) {
file_get_contents($apiURL . "deleteMessage?chat_id=$chatID&message_id=" . $update["message"]["message_id"]);
if ($username && $adminID) {
$messageToAdmin = "⚠️ <b>Alert!</b> @$username sent a message:\n$message";
file_get_contents($apiURL . "sendMessage?chat_id=$adminID&text=" . urlencode($messageToAdmin) . "&parse_mode=HTML");
}
$warning = "⚠️ <b>Sorry!</b> Links are not allowed in this chat!";
file_get_contents($apiURL . "sendMessage?chat_id=$chatID&text=" . urlencode($warning) . "&parse_mode=HTML");
}
}
}
?>
👍2🔥1
🤗 Introduction Flex Codes The Free Source Of Code In File Format
Features You Will Get?
➡️ Best Code File
➡️ Just Download File And Add To Your Server
➡️ Get Bot & Api Codes For Free
➡️ More Coming Soon....
😶🌫️ Bot =>@FlexCodesBot
Features You Will Get?
➡️ Best Code File
➡️ Just Download File And Add To Your Server
➡️ Get Bot & Api Codes For Free
➡️ More Coming Soon....
😶🌫️ Bot =>
⚡1👍1
Flex Coder
New Files Added ✅ 👉 Html Decoder & Encoder File 👉 Guess Game File Added
Error Solve Now You Can Get File 😉
❤1👍1