سو ليوم ا نوريكم كيفاش تصوبو بوت تيلغرام كيدعم الذكاء الاصطناعي ف اقل من 10 دقايق. باعتماد على لغة python و dialogflow لي هو منصة من طرف google و هي مجانية .
◇Telegram python warpper :
https://github.com/python-telegram-bot/python-telegram-bot
◇Dialogflow (Api-ai) python warpper :
https://github.com/dialogflow/dialogflow-python-client
=====================================
=>المرحلة الأولى : نصوبو بوت ف تيلغرام .
https://github.com/python-telegram-bot/python-telegram-bot
◇Dialogflow (Api-ai) python warpper :
https://github.com/dialogflow/dialogflow-python-client
=====================================
=>المرحلة الأولى : نصوبو بوت ف تيلغرام .
1)دخل هنا :
https://t.me/BotFather
2) دير
/newbot
*) وكمل المراحل ديال التسجيل راه ساهلين
3)موراها ايعطيك و http api tolen 3e9l 3lih o mat3tih l ta7ed
=>المرحلة التانية: انكتبو الأساسية ديالنا .
1) صوب مجلد (folder)
2) حلو ب terminal ولا compiler ديالك
3)دير هاد command ف terminal
$pip install python-telegram-bot — upgrade
4) منبعد ميكمل نقدرو نكتبوا الاساسيات لي هوا ارسال نفس الرسالة **** دابا حنا مازلين غا ف telegram
# Settings
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
updater = Updater(token='YOURE API TOKEN') # Telegram API Token
dispatcher = updater.dispatcher
https://t.me/BotFather
2) دير
/newbot
*) وكمل المراحل ديال التسجيل راه ساهلين
3)موراها ايعطيك و http api tolen 3e9l 3lih o mat3tih l ta7ed
=>المرحلة التانية: انكتبو الأساسية ديالنا .
1) صوب مجلد (folder)
2) حلو ب terminal ولا compiler ديالك
3)دير هاد command ف terminal
$pip install python-telegram-bot — upgrade
4) منبعد ميكمل نقدرو نكتبوا الاساسيات لي هوا ارسال نفس الرسالة **** دابا حنا مازلين غا ف telegram
# Settings
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
updater = Updater(token='YOURE API TOKEN') # Telegram API Token
dispatcher = updater.dispatcher
5)
# Command processing
def startCommand(bot, update):
bot.send_message(chat_id=update.message.chat_id, text='Hello, do you want to talk?')
def textMessage(bot, update):
response = 'Got youre message: ' + update.message.text
bot.send_message(chat_id=update.message.chat_id, text=response)
=>>)دبا فهاد المرحلة درنا بلي الى المستخدم دار start/ كنصيفطو ليه الميساج د البداية لي هو hello ,do you want to talk?
* # Handlers
start_command_handler = CommandHandler('start', startCommand)
text_message_handler = MessageHandler(Filters.text, textMessage)
# Here we add the handlers to the dispatcher
dispatcher.add_handler(start_command_handler)
dispatcher.add_handler(text_message_handler)
# Start search for updates
updater.start_polling(clean=True)
# Stop the bot, if Ctrl + C were pressed
updater.idle()
**هنا زدت بعد التعديلات باش لبوت ايبقا ايدير
Search for updates
# Command processing
def startCommand(bot, update):
bot.send_message(chat_id=update.message.chat_id, text='Hello, do you want to talk?')
def textMessage(bot, update):
response = 'Got youre message: ' + update.message.text
bot.send_message(chat_id=update.message.chat_id, text=response)
=>>)دبا فهاد المرحلة درنا بلي الى المستخدم دار start/ كنصيفطو ليه الميساج د البداية لي هو hello ,do you want to talk?
* # Handlers
start_command_handler = CommandHandler('start', startCommand)
text_message_handler = MessageHandler(Filters.text, textMessage)
# Here we add the handlers to the dispatcher
dispatcher.add_handler(start_command_handler)
dispatcher.add_handler(text_message_handler)
# Start search for updates
updater.start_polling(clean=True)
# Stop the bot, if Ctrl + C were pressed
updater.idle()
**هنا زدت بعد التعديلات باش لبوت ايبقا ايدير
Search for updates
*****يتبع



Pالتعليقات:
0 التعليقات: