شـروحات اساسيات لغه PHP
169 subscribers
9 photos
1 video
19 links
Download Telegram
حدزلكم بصمه سمعوها زين لان مهمه
اولا اذا تريد تشغل بوتك باستضافه مجانيه انصحك باستضافه ويبهوست

لكن من عيوبها بطيئه
رابط الاستضافه :
www.webhost.com/signup
كل ما عليك تكتب ايميل حقيقي وتقوم بكتابه كلمه المرور مرتين
بعدها سيقوم بتحويلك الى صفحة ال website
الشرح في الاسفل
رابط شرح انشاء استضافه مجانيه ال webhost :
https://youtu.be/p9m2Kqr6wFE

اسف ع سوء دقة الفيديو عن قريب انزل برنامج سكرين ويصير الشرح واضح
كل ملف تسوي داخل الاستضافه اي ملف كان
يحتاج كود او فاكشن اتصال بين البوت والاستضافه حتى يشغل البوت
وكل استضافه الها فاكشن خاص بيها
<?php

ob_start();

define('API_KEY','توكن');
echo file_get_contents("https://api.telegram.org/bot" . API_KEY . "/setwebhook?url=" . $_SERVER['SERVER_NAME'] . "" . $_SERVER['SCRIPT_NAME']);
function bot($method,$datas=[]){
$url = "https://api.telegram.org/bot".API_KEY."/".$method;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POSTFIELDS,$datas);
$res = curl_exec($ch);
if(curl_error($ch)){
var_dump(curl_error($ch));
}else{
return json_decode($res);
}
}
تروح لبوت فاذر @BotFather
تعطي ابدأ بعدها /newbot
يطلب اسم البوت بتعطي اي اسم كان
بعدها يطلب يوزر البوت او معرف البوت
تكتب كذلك اي معرف كان شرط ينتهي بكلمه bot او _bot
مثال : uju_bot
بعد ما تعطي المعرف حيرسل لك توكن بوت يصير هيج


Done! Congratulations on your new bot. You will find it at t.me/insta_checkbot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.

Use this token to access the HTTP API:


1177022147:AAE5eB_Zvg1gMmWSNzO2i2qwJ3yyHoDjBhY

هذا هو التوكن ☝️☝️☝️
Keep your token secure and store it safely, it can be used by anyone to control your bot.

For a description of the Bot API, see this page: https://core.telegram.org/bots/api