Skip to content

Tli #10

@klashzid1400-creator

Description

@klashzid1400-creator

1. إعداد السيرفر الوهمي لإبقاء البوت يعمل (Keep Alive)

app = Flask('')

@app.route('/')
def home():
return "البوت يعمل الآن 24/7 ✅"

def run():
app.run(host='0.0.0.0', port=8080)

def keep_alive():
t = Thread(target=run)
t.start()

2. إعدادات بوت تليجرام

TOKEN = 'ضع_التوكن_هنا' # احصل عليه من @Botfather
bot = telebot.TeleBot(TOKEN)

@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "أهلاً! أنا بوتك الشغال 24 ساعة بدون توقف 🚀")

@bot.message_handler(func=lambda message: True)
def echo(message):
bot.reply_to(message, f"وصلتني رسالتك: {message.text}")

3. تشغيل السيرفر والبوت معاً

if name == "main":
keep_alive() # تشغيل خدعة الاستيقاظ
print("جاري تشغيل البوت...")
bot.infinity_polling()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions