![]() ![]() ![]() Artikel kali ini akan kita bahas cara mengirim pesan atau message menggunakan PHP via API Telegram ( Bot Telegram ). It works and i can retrieve the data from mysql. elif command '/sessions': cur.execute ('SELECT ip FROM sessions') for result in cur.fetchall (): bot.sendMessage (chatid, result 0) Thanks a lot for your help S. The data i want to retrieve is ip address that locate in table sessions. - Cara Membuat Bot Telegram dan Mengirim Pesan Menggunakan PHP. The execute method returns an iterator rather than the result you are looking for. ![]() import timeĭb = nnect(host="127.0.0.1", # localhostīot.sendMessage(chat_id, 'Hi, I\'m netrapsystembot')īot.sendMessage(chat_id, random.randint(0,9))īot.sendMessage(chat_id, str(()))īot.sendMessage(chat_id, cur.execute('SELECT ip FROM sessions'))īot = telepot.Bot('617662632:AAEGW74VAvZcjEpVCkiye8KLcv2xmSkt0L4') Mysql can connect to the Python and show the data in Python terminal but in telegram, it only shows number of rows only. Send a random dog photo by a its breed and sub-breed:Īfter successfully creating and testing our commands it’s now time to integrate it with Telegram.I have problem, how to retrieve data from Mysql and post to Telegram Bot via Python.Send a random dog photo from all breeds:.$botman -> hears ( 'Bot, What’s the best Web Development training website?', function ( BotMan $bot ) Testing The Bot But before doing that let’s first take a quick look at what Botman is and how it works:īotMan is a framework agnostic PHP library that is designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger and WeChat. The first step we will be taking to create this Bot is installing Laravel and Botman. In this tutorial, you will be creating a Telegram bot for dog lovers using Dog API and this is what it looks like: Laravel and the Botman framework provide the tools to create useful bots. Automated bots are a way to offer customized data to your users based on their requests. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |