{"id":2252,"date":"2022-05-03T01:31:19","date_gmt":"2022-05-03T01:31:19","guid":{"rendered":"https:\/\/blog.ultramsg.com\/%e0%a4%ae%e0%a5%87%e0%a4%95-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%9a%e0%a5%88%e0%a4%9f%e0%a4%ac%e0%a5%89%e0%a4%9f-%e0%a4%89%e0%a4%aa%e0%a4%af\/"},"modified":"2022-05-03T01:31:22","modified_gmt":"2022-05-03T01:31:22","slug":"%e0%a4%ae%e0%a5%87%e0%a4%95-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%9a%e0%a5%88%e0%a4%9f%e0%a4%ac%e0%a5%89%e0%a4%9f-%e0%a4%89%e0%a4%aa%e0%a4%af","status":"publish","type":"post","link":"https:\/\/blog.ultramsg.com\/hi\/%e0%a4%ae%e0%a5%87%e0%a4%95-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%9a%e0%a5%88%e0%a4%9f%e0%a4%ac%e0%a5%89%e0%a4%9f-%e0%a4%89%e0%a4%aa%e0%a4%af\/","title":{"rendered":"\u092a\u093e\u092f\u0925\u0928 \u0915\u0947 \u0938\u093e\u0925 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e\u090f\u0902"},"content":{"rendered":"\n<p><\/p>\n\n<p>\u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e\u0928\u093e \u0905\u0932\u094d\u091f\u094d\u0930\u093e\u090f\u092e\u090f\u0938\u091c\u0940 \u090f\u092a\u0940\u0906\u0908 \u0915\u0947 \u0938\u093e\u0925 \u092c\u0939\u0941\u0924 \u0906\u0938\u093e\u0928 \u0939\u0948, \u0906\u092a \u090f\u0915 \u0917\u094d\u0930\u093e\u0939\u0915 \u0938\u0947\u0935\u093e \u091a\u0948\u091f\u092c\u0949\u091f \u0914\u0930 \u0938\u0930\u094d\u0935\u0936\u094d\u0930\u0947\u0937\u094d\u0920 \u090f\u0906\u0908 \u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e \u0938\u0915\u0924\u0947 \u0939\u0948\u0902 \u092a\u093e\u092f\u0925\u0928 \u092d\u093e\u0937\u093e \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 \u0938\u0930\u0932 \u091a\u0930\u0923\u094b\u0902 \u0915\u0947 \u092e\u093e\u0927\u094d\u092f\u092e \u0938\u0947\u0964<\/p>\n\n<h2 class=\"wp-block-heading\">\u091a\u0948\u091f\u092c\u0949\u091f \u0915\u0947 \u0905\u0935\u0938\u0930 \u0914\u0930 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u092c\u0949\u091f \u0915\u0947 \u0915\u093e\u0930\u094d\u092f<\/h2>\n\n<ul class=\"wp-block-list\"><li>\u0915\u092e\u093e\u0902\u0921 \u0938\u0942\u091a\u0940 \u0915\u093e \u0906\u0909\u091f\u092a\u0941\u091f\u0964<\/li><li>\u092c\u0949\u091f \u0915\u0947 \u0938\u0930\u094d\u0935\u0930 \u0938\u092e\u092f \u0915\u093e \u0906\u0909\u091f\u092a\u0941\u091f \u092a\u0930 \u091a\u0932 \u0930\u0939\u093e \u0939\u0948\u0964<\/li><li>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0938\u092e\u0942\u0939 \u092a\u0930 \u091b\u0935\u093f \u092d\u0947\u091c\u0928\u093e\u0964<\/li><li>\u0911\u0921\u093f\u092f\u094b \u092b\u093e\u0907\u0932 \u092d\u0947\u091c\u0940 \u091c\u093e \u0930\u0939\u0940 \u0939\u0948\u0964<\/li><li>\u092a\u0940\u092a\u0940\u091f\u0940 \u0911\u0921\u093f\u092f\u094b \u0930\u093f\u0915\u0949\u0930\u094d\u0921\u093f\u0902\u0917 \u092d\u0947\u091c \u0930\u0939\u093e \u0939\u0948\u0964<\/li><li>\u0935\u0940\u0921\u093f\u092f\u094b \u092b\u093c\u093e\u0907\u0932 \u092d\u0947\u091c \u0930\u0939\u093e \u0939\u0948\u0964<\/li><li>\u0938\u0902\u092a\u0930\u094d\u0915 \u092d\u0947\u091c \u0930\u0939\u093e \u0939\u0948\u0964<a href=\"https:\/\/github.com\/ultramsg\/python-whatsApp-bot#getting-started\" target=\"_blank\" rel=\"noopener\"><\/a><\/li><\/ul>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 1: \u092b\u094d\u0932\u093e\u0938\u094d\u0915 \u0938\u094d\u0925\u093e\u092a\u093f\u0924 \u0915\u0930\u0947\u0902<br\/><\/h2>\n\n<p>\u0939\u092e\u0947\u0902 \u092b\u094d\u0932\u093e\u0938\u094d\u0915 \u0922\u093e\u0902\u091a\u0947 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 \u0938\u0930\u094d\u0935\u0930 \u0915\u094b \u0924\u0948\u0928\u093e\u0924 \u0915\u0930\u0928\u0947 \u0915\u0940 \u0906\u0935\u0936\u094d\u092f\u0915\u0924\u093e \u0939\u0948\u0964<br\/>\u092b\u094d\u0932\u093e\u0938\u094d\u0915 \u0906\u0928\u0947 \u0935\u093e\u0932\u0947 \u0905\u0928\u0941\u0930\u094b\u0927\u094b\u0902 \u0915\u093e \u0906\u0938\u093e\u0928\u0940 \u0938\u0947 \u091c\u0935\u093e\u092c \u0926\u0947\u0928\u0947 \u0914\u0930 \u0909\u0928\u094d\u0939\u0947\u0902 \u0938\u0902\u0938\u093e\u0927\u093f\u0924 \u0915\u0930\u0928\u0947 \u0915\u0940 \u0905\u0928\u0941\u092e\u0924\u093f \u0926\u0947\u0924\u093e \u0939\u0948\u0964<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">pip install flask<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 2: ngrok . \u0938\u094d\u0925\u093e\u092a\u093f\u0924 \u0915\u0930\u0947\u0902<br\/><\/h2>\n\n<p>\u0938\u094d\u0925\u093e\u0928\u0940\u092f \u0935\u093f\u0915\u093e\u0938 \u0909\u0926\u094d\u0926\u0947\u0936\u094d\u092f\u094b\u0902 \u0915\u0947 \u0932\u093f\u090f, \u090f\u0915 \u0938\u0941\u0930\u0902\u0917 \u0938\u0947\u0935\u093e \u0915\u0940 \u0906\u0935\u0936\u094d\u092f\u0915\u0924\u093e \u0939\u0948\u0964 \u092f\u0939 \u0909\u0926\u093e\u0939\u0930\u0923 <a href=\"https:\/\/ngrok.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">ngrok<\/a> \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0924\u093e \u0939\u0948, \u0906\u092a <a href=\"https:\/\/ngrok.com\/download\" target=\"_blank\" rel=\"noreferrer noopener\">\u092f\u0939\u093e\u0902<\/a> \u0938\u0947 ngrok \u0921\u093e\u0909\u0928\u0932\u094b\u0921 \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964<\/p>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 3: \u0928\u092f\u093e \u092b\u094d\u0932\u093e\u0938\u094d\u0915 \u0910\u092a \u092c\u0928\u093e\u090f\u0902<\/h2>\n\n<p>\u0939\u092e \u092b\u093e\u0907\u0932 \u092c\u0928\u093e\u090f\u0902\u0917\u0947: <strong>app.py<\/strong> \u0914\u0930 \u0939\u092e \u0909\u0938\u0915\u0947 \u0905\u0902\u0926\u0930 \u0928\u093f\u092e\u094d\u0928\u0932\u093f\u0916\u093f\u0924 \u0915\u094b\u0921 \u0932\u093f\u0916\u0924\u0947 \u0939\u0948\u0902<\/p>\n\n<pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">from flask import Flask, request, jsonify\nfrom ultrabot import ultraChatBot\nimport json\n\napp = Flask(__name__)\n\n@app.route('\/', methods=['POST'])\ndef home():\n    if request.method == 'POST':\n        bot = ultraChatBot(request.json)\n        return bot.Processing\u0640incoming\u0640messages()\n\nif(__name__) == '__main__':\n    app.run()<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 4: \u0906\u0928\u0947 \u0935\u093e\u0932\u0940 \u0938\u0902\u0926\u0947\u0936 \u092a\u094d\u0930\u0938\u0902\u0938\u094d\u0915\u0930\u0923<\/h2>\n\n<p>\u0939\u092e \u092b\u093e\u0907\u0932 \u092c\u0928\u093e\u090f\u0902\u0917\u0947: <strong>ultrabot.py<\/strong> \u0914\u0930 \u0939\u092e \u0907\u0938\u0915\u0947 \u0905\u0902\u0926\u0930 \u0928\u093f\u092e\u094d\u0928\u0932\u093f\u0916\u093f\u0924 \u0915\u094b\u0921 \u0932\u093f\u0916\u0924\u0947 \u0939\u0948\u0902<\/p>\n\n<pre class=\"wp-block-preformatted\"><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">import json\nimport requests\nimport datetime\n\nclass ultraChatBot():    \n    def __init__(self, json):\n        self.json = json\n        self.dict_messages = json['data']\n        self.ultraAPIUrl = 'https:\/\/api.ultramsg.com\/{{instance_id}}\/'\n        self.token = '{{token}}'\n\n   \n    def send_requests(self, type, data):\n        url = f\"{self.ultraAPIUrl}{type}?token={self.token}\"\n        headers = {'Content-type': 'application\/json'}\n        answer = requests.post(url, data=json.dumps(data), headers=headers)\n        return answer.json()\n\n    def send_message(self, chatID, text):\n        data = {\"to\" : chatID,\n                \"body\" : text}  \n        answer = self.send_requests('messages\/chat', data)\n        return answer\n\n    def send_image(self, chatID):\n        data = {\"to\" : chatID,\n                \"image\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/images\/test.jpeg\"}  \n        answer = self.send_requests('messages\/image', data)\n        return answer\n\n    def send_video(self, chatID):\n        data = {\"to\" : chatID,\n                \"video\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/video\/test.mp4\"}  \n        answer = self.send_requests('messages\/video', data)\n        return answer\n\n    def send_audio(self, chatID):\n        data = {\"to\" : chatID,\n                \"audio\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/audio\/2.mp3\"}  \n        answer = self.send_requests('messages\/audio', data)\n        return answer\n\n\n    def send_voice(self, chatID):\n        data = {\"to\" : chatID,\n                \"audio\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/voice\/oog_example.ogg\"}  \n        answer = self.send_requests('messages\/voice', data)\n        return answer\n\n    def send_contact(self, chatID):\n        data = {\"to\" : chatID,\n                \"contact\" : \"14000000001@c.us\"}  \n        answer = self.send_requests('messages\/contact', data)\n        return answer\n\n\n    def time(self, chatID):\n        t = datetime.datetime.now()\n        time = t.strftime('%Y-%m-%d %H:%M:%S')\n        return self.send_message(chatID, time)\n\n\n    def welcome(self,chatID, noWelcome = False):\n        welcome_string = ''\n        if (noWelcome == False):\n            welcome_string = \"Hi , welcome to WhatsApp chatbot using Python\\n\"\n        else:\n            welcome_string = \"\"\"wrong command\nPlease type one of these commands:\n*hi* : Saluting\n*time* : show server time\n*image* : I will send you a picture\n*video* : I will send you a Video\n*audio* : I will send you a audio file\n*voice* : I will send you a ppt audio recording\n*contact* : I will send you a contact\n\"\"\"\n        return self.send_message(chatID, welcome_string)\n\n\n    def Processing\u0640incoming\u0640messages(self):\n        if self.dict_messages != []:\n            message =self.dict_messages\n            text = message['body'].split()\n            if not message['fromMe']:\n                chatID  = message['from'] \n                if text[0].lower() == 'hi':\n                    return self.welcome(chatID)\n                elif text[0].lower() == 'time':\n                    return self.time(chatID)\n                elif text[0].lower() == 'image':\n                    return self.send_image(chatID)\n                elif text[0].lower() == 'video':\n                    return self.send_video(chatID)\n                elif text[0].lower() == 'audio':\n                    return self.send_audio(chatID)\n                elif text[0].lower() == 'voice':\n                    return self.send_voice(chatID)\n                elif text[0].lower() == 'contact':\n                    return self.send_contact(chatID)\n                else:\n                    return self.welcome(chatID, True)\n            else: return 'NoCommand'<\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 5: \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u091a\u0948\u091f\u092c\u0949\u091f \u092a\u094d\u0930\u094b\u091c\u0947\u0915\u094d\u091f \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902 <\/h2>\n\n<h3 class=\"wp-block-heading\">\u092b\u094d\u0932\u093e\u0938\u094d\u0915 \u0938\u0930\u094d\u0935\u0930 \u091a\u0932\u093e\u090f\u0902<\/h3>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">flask run<\/code><\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">\u092d\u093e\u0917\u094b ngrok<\/h3>\n\n<p>\u0935\u093f\u0902\u0921\u094b\u091c\u093c \u0915\u0947 \u0932\u093f\u090f \u090f\u0928\u0917\u094d\u0930\u094b\u0915 \u091a\u0932\u093e\u090f\u0902:<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">ngrok http 5000<\/code><\/code><\/pre>\n\n<p>\u092e\u0948\u0915 \u0915\u0947 \u0932\u093f\u090f ngrok \u091a\u0932\u093e\u090f\u0901:<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">.\/ngrok http 5000<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\">\u091a\u0930\u0923 6 : URL Webhook \u0915\u094b \u0907\u0902\u0938\u094d\u091f\u0947\u0902\u0938 \u0938\u0947\u091f\u093f\u0902\u0917 \u092e\u0947\u0902 \u0938\u0947\u091f \u0915\u0930\u0947\u0902<\/h2>\n\n<p>ngrok \u091a\u0932\u093e\u0928\u0947 \u0915\u0947 \u092c\u093e\u0926, \u0906\u092a\u0915\u094b \u0909\u0926\u093e\u0939\u0930\u0923 \u0915\u0947 \u0932\u093f\u090f \u090f\u0915 \u0926\u0947\u0916\u0928\u093e \u091a\u093e\u0939\u093f\u090f:<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"powershell\" class=\"EnlighterJSRAW\">https:\/\/7647-115-83-121-164.ngrok.io<\/code><\/code><\/pre>\n\n<p>\u0907\u0902\u0938\u094d\u091f\u0947\u0902\u0938 \u0938\u0947\u091f\u093f\u0902\u0917\u094d\u0938 \u092e\u0947\u0902 \u0905\u092a\u0928\u093e \u092f\u0942\u0906\u0930\u090f\u0932 \u092a\u0947\u0938\u094d\u091f \u0915\u0930\u0947\u0902 \u060c \u0928\u093f\u092e\u094d\u0928 \u091a\u093f\u0924\u094d\u0930 \u0915\u0947 \u0930\u0942\u092a \u092e\u0947\u0902:<\/p>\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.ultramsg.com\/wp-content\/uploads\/2022\/03\/image-1024x612.png\" alt=\"&#x92A;&#x93E;&#x92F;&#x925;&#x928; &#x914;&#x930; &#x935;&#x947;&#x92C;&#x939;&#x941;&#x915;-&#x905;&#x932;&#x94D;&#x91F;&#x94D;&#x930;&#x93E;&#x92E;&#x94D;&#x938;&#x91C;&#x940; &#x915;&#x93E; &#x909;&#x92A;&#x92F;&#x94B;&#x917; &#x915;&#x930;&#x915;&#x947; &#x935;&#x94D;&#x939;&#x93E;&#x91F;&#x94D;&#x938;&#x90F;&#x92A; &#x938;&#x902;&#x926;&#x947;&#x936; &#x92A;&#x94D;&#x930;&#x93E;&#x92A;&#x94D;&#x924; &#x915;&#x930;&#x947;&#x902;\" title=\"\"><\/figure><\/div>\n\n<h2 class=\"wp-block-heading\">\u0915\u094b\u0921 \u092e\u0947\u0902 \u092a\u094d\u0930\u092f\u0941\u0915\u094d\u0924 \u091a\u0948\u091f\u092c\u0949\u091f \u092b\u0902\u0915\u094d\u0936\u0928<\/h2>\n\n<h3 class=\"wp-block-heading\">\u092e\u0947\u0938\u0947\u091c \u092d\u0947\u091c\u0947\u0902<\/h3>\n\n<p>\u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u091f\u0947\u0915\u094d\u0938\u094d\u091f \u092e\u0948\u0938\u0947\u091c \u092d\u0947\u091c\u0928\u0947 \u0915\u0947 \u0932\u093f\u090f \u0907\u0938\u094d\u0924\u0947\u092e\u093e\u0932 \u0915\u093f\u092f\u093e \u091c\u093e\u0924\u093e \u0939\u0948<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_message(self, chatID, text):\n    data = {\"to\" : chatID,\n        \"body\" : text}  \n    answer = self.send_requests('messages\/chat', data)\n    return answer<\/code><\/code><\/pre>\n\n<ul class=\"wp-block-list\"><li>\u091a\u0948\u091f\u0906\u0908\u0921\u0940 &#8211; \u0909\u0938 \u091a\u0948\u091f \u0915\u0940 \u0906\u0908\u0921\u0940 \u091c\u0939\u093e\u0902 \u0909\u0938\u0915\u0947 \u0932\u093f\u090f \u0938\u0902\u0926\u0947\u0936 \u092d\u0947\u091c\u093e \u091c\u093e\u0928\u093e \u091a\u093e\u0939\u093f\u090f, \u0909\u0926\u093e\u0939\u0930\u0923 \u0915\u0947 \u0932\u093f\u090f <a href=\"mailto:14155552671@c.us\">14155552671@c.us<\/a> \u0964<\/li><li>\u092a\u093e\u0920 &#8211; \u0938\u0902\u0926\u0947\u0936 \u0915\u093e \u092a\u093e\u0920\u0964<\/li><\/ul>\n\n<h3 class=\"wp-block-heading\">\u0938\u092e\u092f<\/h3>\n\n<p>\u0935\u0930\u094d\u0924\u092e\u093e\u0928 \u0938\u0930\u094d\u0935\u0930 \u0938\u092e\u092f \u092d\u0947\u091c\u0924\u093e \u0939\u0948\u0964<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def time(self, chatID):\n    t = datetime.datetime.now()\n    time = t.strftime('%Y-%m-%d %H:%M:%S')\n    return self.send_message(chatID, time)<\/code><\/code><\/pre>\n\n<ul class=\"wp-block-list\"><li>\u091a\u0948\u091f\u0906\u0908\u0921\u0940 &#8211; \u0909\u0938 \u091a\u0948\u091f \u0915\u0940 \u0906\u0908\u0921\u0940 \u091c\u0939\u093e\u0902 \u0909\u0938\u0915\u0947 \u0932\u093f\u090f \u0938\u0902\u0926\u0947\u0936 \u092d\u0947\u091c\u093e \u091c\u093e\u0928\u093e \u091a\u093e\u0939\u093f\u090f, \u0909\u0926\u093e\u0939\u0930\u0923 \u0915\u0947 \u0932\u093f\u090f <a href=\"mailto:14155552671@c.us\">14155552671@c.us<\/a> \u0964<\/li><\/ul>\n\n<h3 class=\"wp-block-heading\">\u092d\u0947\u091c\u0947\u0902_\u091b\u0935\u093f<\/h3>\n\n<p>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0938\u092e\u0942\u0939 \u092a\u0930 \u090f\u0915 \u091b\u0935\u093f \u092d\u0947\u091c\u0947\u0902<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_image(self, chatID):\n    data = {\"to\" : chatID,\n        \"image\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/images\/test.jpeg\"}  \n    answer = self.send_requests('messages\/image', data)\n    return answer<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/ultramsg\/python-whatsApp-bot#send_video\" target=\"_blank\" rel=\"noopener\"><\/a><a href=\"https:\/\/github.com\/ultramsg\/python-whatsApp-bot#send_image\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n<h3 class=\"wp-block-heading\">\u0935\u0940\u0921\u093f\u092f\u094b \u092d\u0947\u091c\u0928\u093e<\/h3>\n\n<p>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0917\u094d\u0930\u0941\u092a \u092a\u0930 \u0935\u0940\u0921\u093f\u092f\u094b \u092d\u0947\u091c\u0947\u0902<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_video(self, chatID):\n    data = {\"to\" : chatID,\n        \"video\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/video\/test.mp4\"}  \n    answer = self.send_requests('messages\/video', data)\n    return answer<\/code><\/code><\/pre>\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/github.com\/ultramsg\/python-whatsApp-bot#time\" target=\"_blank\" rel=\"noopener\"><\/a><\/h2>\n\n<h3 class=\"wp-block-heading\">\u092d\u0947\u091c\u0947\u0902_\u0911\u0921\u093f\u092f\u094b<\/h3>\n\n<p>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0938\u092e\u0942\u0939 \u092a\u0930 \u090f\u0915 \u0911\u0921\u093f\u092f\u094b \u092b\u093c\u093e\u0907\u0932 \u092d\u0947\u091c\u0947\u0902<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_audio(self, chatID):\n    data = {\"to\" : chatID,\n        \"audio\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/audio\/2.mp3\"}  \n    answer = self.send_requests('messages\/audio', data)\n    return answer<\/code><\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">\u092d\u0947\u091c\u0947\u0902_\u0906\u0935\u093e\u091c<br\/><\/h3>\n\n<p>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0938\u092e\u0942\u0939 \u092a\u0930 \u090f\u0915 \u092a\u0940\u092a\u0940\u091f\u0940 \u0911\u0921\u093f\u092f\u094b \u0930\u093f\u0915\u0949\u0930\u094d\u0921\u093f\u0902\u0917 \u092d\u0947\u091c\u0947\u0902<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_voice(self, chatID):\n    data = {\"to\" : chatID,\n        \"audio\" : \"https:\/\/file-example.s3-accelerate.amazonaws.com\/voice\/oog_example.ogg\"}  \n    answer = self.send_requests('messages\/voice', data)\n    return answer<\/code><\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">\u092d\u0947\u091c\u0947\u0902_\u0938\u0902\u092a\u0930\u094d\u0915<\/h3>\n\n<p>\u092b\u093c\u094b\u0928 \u0928\u0902\u092c\u0930 \u092f\u093e \u0938\u092e\u0942\u0939 \u0915\u094b \u090f\u0915 \u0938\u0902\u092a\u0930\u094d\u0915 \u092f\u093e \u0938\u0902\u092a\u0930\u094d\u0915 \u0938\u0942\u091a\u0940 \u092d\u0947\u091c\u0928\u093e<\/p>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def send_contact(self, chatID):\n    data = {\"to\" : chatID,\n        \"contact\" : \"14000000001@c.us\"}  \n    answer = self.send_requests('messages\/contact', data)\n    return answer<\/code><\/code><\/pre>\n\n<h3 class=\"wp-block-heading\">\u092a\u094d\u0930\u0938\u0902\u0938\u094d\u0915\u0930\u0923\u0640\u0906\u0928\u0947 \u0935\u093e\u0932\u0947\u0640\u0938\u0902\u0926\u0947\u0936<\/h3>\n\n<pre class=\"wp-block-code\"><code><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">def Processing\u0640incoming\u0640messages(self):\n    if self.dict_messages != &#91;]:\n        message =self.dict_messages\n        text = message&#91;'body'].split()\n        if not message&#91;'fromMe']:\n        chatID  = message&#91;'from'] \n        if text&#91;0].lower() == 'hi':\n            return self.welcome(chatID)\n        elif text&#91;0].lower() == 'time':\n            return self.time(chatID)\n        elif text&#91;0].lower() == 'image':\n            return self.send_image(chatID)\n        elif text&#91;0].lower() == 'video':\n            return self.send_video(chatID)\n        elif text&#91;0].lower() == 'audio':\n            return self.send_audio(chatID)\n        elif text&#91;0].lower() == 'voice':\n            return self.send_voice(chatID)\n        elif text&#91;0].lower() == 'contact':\n            return self.send_contact(chatID)\n        else:\n            return self.welcome(chatID, True)\n        else: return 'NoCommand'<\/code><\/code><\/pre>\n\n<p>\u0906\u092a \u0907\u0938 \u0935\u0940\u0921\u093f\u092f\u094b \u092e\u0947\u0902 \u092a\u093f\u091b\u0932\u0947 \u091a\u0930\u0923 \u0926\u0947\u0916 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902:<\/p>\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Build a WhatsApp Chatbot With Python using Ultramsg WhatsApp API\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/W3dQp375wWY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n<h2 class=\"wp-block-heading\">\u0909\u092a\u092f\u094b\u0917\u0940 \u0915\u0921\u093c\u093f\u092f\u093e\u0902<\/h2>\n\n<ul class=\"wp-block-list\"><li>\u0938\u092d\u0940 \u0915\u094b\u0921 <a href=\"https:\/\/github.com\/ultramsg\/python-whatsApp-bot\" target=\"_blank\" rel=\"noopener\">GitHub<\/a> \u092a\u0930 \u0909\u092a\u0932\u092c\u094d\u0927 \u0939\u0948\u0902\u0964<\/li><li>\u092a\u093e\u092f\u0925\u0928 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 <a href=\"https:\/\/blog.ultramsg.com\/programmable-whatsapp-api-messaging-using-python\/\" data-type=\"URL\" data-id=\"https:\/\/blog.ultramsg.com\/programmable-whatsapp-api-messaging-using-python\/\">\u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u090f\u092a\u0940\u0906\u0908<\/a> \u0938\u0902\u0926\u0947\u0936 \u092d\u0947\u091c\u0947\u0902\u0964<\/li><li><a href=\"https:\/\/www.youtube.com\/watch?v=kipBHDOsFKI\" data-type=\"URL\" data-id=\"https:\/\/www.youtube.com\/watch?v=kipBHDOsFKI\" rel=\"nofollow noopener\" target=\"_blank\">Ultramsg \u092a\u094d\u0932\u0947\u091f\u092b\u0949\u0930\u094d\u092e \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 WebHooks \u0915\u0948\u0938\u0947 \u0938\u0947\u091f \u0915\u0930\u0947\u0902<\/a><\/li><li>\u092a\u093e\u092f\u0925\u0928 \u0914\u0930 \u0935\u0947\u092c\u0939\u0941\u0915 \u0915\u093e \u0909\u092a\u092f\u094b\u0917 \u0915\u0930\u0915\u0947 <a href=\"https:\/\/blog.ultramsg.com\/how-to-receive-whatsapp-messages-python-webhook\/\" data-type=\"URL\" data-id=\"https:\/\/blog.ultramsg.com\/how-to-receive-whatsapp-messages-python-webhook\/\">\u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u0938\u0902\u0926\u0947\u0936<\/a> \u0915\u0948\u0938\u0947 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u0930\u0947\u0902\u0964<\/li><\/ul>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e\u0928\u093e \u0905\u0932\u094d\u091f\u094d\u0930\u093e\u090f\u092e\u090f\u0938\u091c\u0940 \u090f\u092a\u0940\u0906\u0908 \u0915\u0947 \u0938\u093e\u0925 \u092c\u0939\u0941\u0924 \u0906\u0938\u093e\u0928 \u0939\u0948, \u0906\u092a \u090f\u0915 \u0917\u094d\u0930\u093e\u0939\u0915 \u0938\u0947\u0935\u093e \u091a\u0948\u091f\u092c\u0949\u091f \u0914\u0930 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"\u092a\u093e\u092f\u0925\u0928 \u0915\u0947 \u0938\u093e\u0925 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e\u090f\u0902\" class=\"read-more button\" href=\"https:\/\/blog.ultramsg.com\/hi\/%e0%a4%ae%e0%a5%87%e0%a4%95-%e0%a4%b5%e0%a5%8d%e0%a4%b9%e0%a4%be%e0%a4%9f%e0%a5%8d%e0%a4%b8%e0%a4%8f%e0%a4%aa-%e0%a4%9a%e0%a5%88%e0%a4%9f%e0%a4%ac%e0%a5%89%e0%a4%9f-%e0%a4%89%e0%a4%aa%e0%a4%af\/#more-2252\" aria-label=\"Read more about \u092a\u093e\u092f\u0925\u0928 \u0915\u0947 \u0938\u093e\u0925 \u0935\u094d\u0939\u093e\u091f\u094d\u0938\u090f\u092a \u091a\u0948\u091f\u092c\u0949\u091f \u092c\u0928\u093e\u090f\u0902\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":2244,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[186],"tags":[191,189,187,190],"class_list":["post-2252","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-186","tag-191","tag-189","tag-187","tag-190","infinite-scroll-item","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-25","no-featured-image-padding"],"_links":{"self":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/comments?post=2252"}],"version-history":[{"count":3,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2252\/revisions"}],"predecessor-version":[{"id":2255,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/posts\/2252\/revisions\/2255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/media\/2244"}],"wp:attachment":[{"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/media?parent=2252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/categories?post=2252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ultramsg.com\/hi\/wp-json\/wp\/v2\/tags?post=2252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}