متد ها 
              
                گرفتن اطلاعات بات
               
              
              
                این متد اطلاعات پایهای بات را برمیگرداند. معمولاً برای تست
                اتصال بات و شناسایی آن استفاده میشود و هیچ پارامتری به عنوان
                ورودی دریافت نمیکند.
              
               
              
              
              
              
                ارسال پیام (Text, Keypad, InlineKeypad)
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendMessage'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "text" :  "Welcome" , 
            "inline_keypad" :  { 
                "rows" :  [ 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "100" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Add Account" 
                            } 
                        ] 
                    }, 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "101" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Edit Account" 
                            }, 
                            { 
                                "id" :  "102" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Remove Account" 
                            } 
                        ] 
                    } 
                ] 
            } 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
import  json 
url  =  f "https://botapi.rubika.ir/v3/ { token } /sendMessage" 
data  =  { 
    "chat_id" :  chat_id , 
    "text" :  "Welcome" , 
    "inline_keypad" :  { 
        "rows" :  [ 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "100" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Add Account" 
                    } 
                ] 
            }, 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "101" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Edit Account" 
                    }, 
                    { 
                        "id" :  "102" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Remove Account" 
                    } 
                ] 
            } 
        ] 
    } 
} 
headers  =  { 
    'Content-Type' :  'application/json' 
} 
response  =  requests . post ( url ,  headers = headers ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_message 
from  rubika_bot.models  import  Keypad ,  KeypadRow ,  Button 
b1  =  Button ( id = '100' ,  type = 'Simple' ,  button_text = 'Add Account' ) 
b2  =  Button ( id = '101' ,  type = 'Simple' ,  button_text = 'Edit Account' ) 
b3  =  Button ( id = '102' ,  type = 'Simple' ,  button_text = 'Remove Account' ) 
keypad  =  Keypad ( 
    rows = [ 
        KeypadRow ( buttons = [ b1 ]), 
        KeypadRow ( buttons = [ b2 ,  b3 ]) 
    ], 
) 
send_message ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    text = 'Welcome' , 
    inline_keypad = keypad 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendMessage' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
       "chat_id" :   chat_id ,  
       "text" :   "hello world"  
       "inline_keypad" :   {  
         "rows" :   [  
           {  
             "buttons" :   [  
               {  
                 "id" :   "100" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Add Account"  
               }  
             ]  
           },  
           {  
             "buttons" :   [  
               {  
                 "id" :   "101" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Edit Account"  
               },  
               {  
                 "id" :   "102" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Remove Account"  
               }  
             ]  
           }  
         ]  
       }  
     })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ارسال keypad
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendMessage'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "text" :  "Welcome" , 
            "chat_keypad_type" :  "New" , 
            "chat_keypad" :  { 
                "rows" :  [ 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "100" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Add Account" 
                            } 
                        ] 
                    }, 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "101" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Edit Account" 
                            }, 
                            { 
                                "id" :  "102" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Remove Account" 
                            } 
                        ] 
                    } 
                ], 
                "resize_keyboard" :  true , 
                "on_time_keyboard" :  false 
            } 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
import  json 
url  =  f "https://botapi.rubika.ir/v3/ { token } /sendMessage" 
data  =  { 
    "chat_id" :  chat_id , 
    "text" :  "Welcome" , 
    "chat_keypad_type" :  "New" , 
    "chat_keypad" :  { 
        "rows" :  [ 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "100" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Add Account" 
                    } 
                ] 
            }, 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "101" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Edit Account" 
                    }, 
                    { 
                        "id" :  "102" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Remove Account" 
                    } 
                ] 
            } 
        ], 
        "resize_keyboard" :  True , 
        "on_time_keyboard" :  False 
    } 
} 
headers  =  { 
    'Content-Type' :  'application/json' 
} 
response  =  requests . post ( url ,  headers = headers ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_message 
from  rubika_bot.models  import  Keypad ,  KeypadRow ,  Button 
b1  =  Button ( id = '100' ,  type = 'Simple' ,  button_text = 'Add Account' ) 
b2  =  Button ( id = '101' ,  type = 'Simple' ,  button_text = 'Edit Account' ) 
b3  =  Button ( id = '102' ,  type = 'Simple' ,  button_text = 'Remove Account' ) 
keypad  =  Keypad ( 
    rows = [ 
        KeypadRow ( buttons = [ b1 ]), 
        KeypadRow ( buttons = [ b2 ,  b3 ]) 
    ], 
    resize_keyboard = True , 
    on_time_keyboard = False 
) 
send_message ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    text = 'Welcome' , 
    chat_keypad_type = 'New' , 
    chat_keypad = keypad 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendMessage' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
       "chat_id" :   chat_id ,  
       "chat_keypad_type" :   "New" ,  
       "text" :   "Welcome" ,  
       "chat_keypad" :   {  
         "rows" :   [  
           {  
             "buttons" :   [  
               {  
                 "id" :   "100" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Add Account"  
               }  
             ]  
           },  
           {  
             "buttons" :   [  
               {  
                 "id" :   "101" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Edit Account"  
               },  
               {  
                 "id" :   "102" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Remove Account"  
               }  
             ]  
           }  
         ],  
         "resize_keyboard" :   true ,  
         "on_time_keyboard" :   false  
       }  
     })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ارسال پیام متنی
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendMessage'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "text" :  "Hello user, this is my text" , 
            "chat_id" :  " {chat_id} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "text" :  "Hello user, this is my text" , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /sendMessage' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_message 
send_message ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    text = 'Hello World' , 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendMessage' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "text" :   "Hello user, this is my text"  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ارسال نظرسنجی
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendPoll'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "question" :  "Do you have any question?" , 
            "options" :  [ "yes" ,  "no" ] 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "question" :  "Do you have any question?" , 
    "options" :  [ "yes" ,  "no" ], 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /sendPoll' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_poll 
send_poll ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    question = 'Do you have any question?' , 
    options = [ 'yes' ,  'no' ] 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendPoll' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "question" :   "Do you have any question?" ,  
     "options" :   [ "yes" ,   "no" ],  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ارسال موقعیت مکانی
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendLocation'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "latitude" :  " {latitude} " , 
            "longitude" :  " {longitude} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "latitude" :  latitude , 
    "longitude" :  longitude , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /sendLocation' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_location 
send_location ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    latitude = '35.759662741892626' , 
    longitude = '51.4036344416759' 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendLocation' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "latitude" :   latitude ,  
     "longitude" :   longitude ,  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ارسال مخاطب
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendContact'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "first_name" :  " {first_name} " , 
            "last_name" :  " {last_name} " , 
            "phone_number" :  " {phone_number} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "first_name" :  first_name , 
    "last_name" :  last_name , 
    "phone_number" :  phone_number , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /sendContact' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  send_contact 
send_contact ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    first_name = 'Ali' , 
    last_name = 'Rn' , 
    phone_number = '09038754321' 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendContact' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "first_name" :   first_name ,  
     "last_name" :   last_name ,  
     "phone_number" :   phone_number  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                گرفتن اطلاعات چت
               
              
              
              
              
              
              
                گرفتن آخرین آپدیتها
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/getUpdates'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "limit" :  " {limit} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "limit" :  limit , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /getUpdates' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  get_updates 
from  rubika_bot.models  import  Update 
updates ,  _  =  get_updates ( 
    token = 'SUPER_SECRET_TOKEN' , 
    limit = 10 , 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/getUpdates' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "limit" :   limit ,  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                فوروارد کردن پیام
               
              
                متد: forwardMessage 
                ورودی 
               
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/forwardMessage'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "from_chat_id" :  " {chat_id} " , 
            "message_id" :  " {message_id} " , 
            "to_chat_id" :  " {to_chat_id} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "from_chat_id" :  chat_id , 
    "message_id" :  message_id , 
    "to_chat_id" :  to_chat_id 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /frowardMessage' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  forward_message 
forward_message ( 
    token = 'SUPER_SECRET_TOKEN' , 
    from_chat_id = 'FIRST_CHAT_ID' , 
    message_id = 'MESSAGE_ID' , 
    to_chat_id = 'SECOND_CHAT_ID' 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/frowardMessage' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "from_chat_id" :   from_chat_id ,  
     "message_id" :   message_id ,  
     "to_chat_id" :   to_chat_id  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ویرایش متن پیام
               
              
                متد: editMessageText 
                ورودی 
               
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/editMessageText'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "message_id" :  " {message_id} " , 
            "text" :  "this is my new text" 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "message_id" :  message_id , 
    "text" :  "this is my new text" 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /editMessageText' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  edit_message_text 
edit_message_text ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    message_id = 'MESSAGE_ID' , 
    text = 'New Message Text' 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/editMessageText' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "message_id" :   message_id ,  
     "text" :   "this is my new text"  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ویرایش Inline Keypad
               
              
                متد: editMessageKeypad 
                ورودی 
               
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/editInlineKeypad'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "message_id" :  " {message_id} " , 
            "inline_keypad" :  { 
                "rows" :  [ 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "100" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Add Account" 
                            } 
                        ] 
                    }, 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "101" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Edit Account" 
                            }, 
                            { 
                                "id" :  "102" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Remove Account" 
                            } 
                        ] 
                    } 
                ] 
            } 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
import  json 
url  =  f "https://botapi.rubika.ir/v3/ { token } /editMessageText" 
data  =  { 
  "chat_id" :  chat_id , 
  "message_id" :  message_id , 
  "inline_keypad" :  { 
    "rows" :  [ 
      { 
        "buttons" :  [ 
          { 
            "id" :  "100" , 
            "type" :  "Simple" , 
            "button_text" :  "Add Account" 
          } 
        ] 
      }, 
      { 
        "buttons" :  [ 
          { 
            "id" :  "101" , 
            "type" :  "Simple" , 
            "button_text" :  "Edit Account" 
          }, 
          { 
            "id" :  "102" , 
            "type" :  "Simple" , 
            "button_text" :  "Remove Account" 
          } 
        ] 
      } 
    ] 
  } 
} 
headers  =  { 
  'Content-Type' :  'application/json' 
} 
response  =  requests . post ( url ,  headers = headers ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  edit_message_keypad 
from  rubika_bot.models  import  Button ,  Keypad ,  KeypadRow 
b1  =  Button ( id = '100' ,  type = 'Simple' ,  button_text = 'Add Account' ) 
b2  =  Button ( id = '101' ,  type = 'Simple' ,  button_text = 'Edit Account' ) 
b3  =  Button ( id = '102' ,  type = 'Simple' ,  button_text = 'Remove Account' ) 
new_keypad  =  Keypad ( 
    rows = [ 
        KeypadRow ( buttons = [ b1 ]), 
        KeypadRow ( buttons = [ b2 ,  b3 ]) 
    ], 
) 
edit_message_keypad ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    message_id = 'MESSAGE_ID' , 
    inline_keypad = new_keypad 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/editMessageText' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
       "chat_id" :   chat_id ,  
       "message_id" :   message_id ,  
       "inline_keypad" :   {  
         "rows" :   [  
           {  
             "buttons" :   [  
               {  
                 "id" :   "100" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Add Account"  
               }  
             ]  
           },  
           {  
             "buttons" :   [  
               {  
                 "id" :   "101" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Edit Account"  
               },  
               {  
                 "id" :   "102" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Remove Account"  
               }  
             ]  
           }  
         ]  
       }  
     })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                حذف پیام
               
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/deleteMessage'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "message_id" :  " {message_id} " 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "message_id" :  chat_id 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /deleteMessage' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  delete_message 
delete_message ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    message_id = 'MESSAGE_ID' , 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/deleteMessage' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "message_id" :   message_id  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                تنظیم دستورها (commands)
               
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/setCommands'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "bot_commands" :  [ 
                { 
                    "command" :  "command1" , 
                    "description" :  "description1" 
                }, 
                { 
                    "command" :  "command2" , 
                    "description" :  "description2" 
                }, 
            ] 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "bot_commands" :  [ 
        { 
            "command" :  "command1" , 
            "description" :  "description1" 
        }, 
        { 
            "command" :  "command2" , 
            "description" :  "description2" 
        }, 
    ] 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /setCommands' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  set_commands 
from  rubika_bot.models  import  BotCommand 
commands  =  [ 
    BotCommand ( command = 'command1' ,  description = 'description 1' ), 
    BotCommand ( command = 'command2' ,  description = 'description 2' ), 
] 
set_commands ( token = 'SUPER_SECRET_TOKEN' ,  bot_commands = commands ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/setCommands' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
       "bot_commands" :   [  
           {  
               "command" :   "command1" ,  
               "description" :   "description1"  
           },  
           {  
               "command" :   "command2" ,  
               "description" :   "description2"  
           },  
       ]  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                آپدیت آدرس بات (URL Endpoint)
               
              
                متد: updateBotEndpoints 
                ورودی 
               
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/updateBotEndpoints'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "url" :  "https://example.com" , 
            "type" :  "GetSelectionItem" 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    'url' :  'https://example.com' , 
    'type' :  'GetSelectionItem' , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /updateBotEndpoints' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  update_bot_endpoint 
update_bot_endpoint ( token = 'SUPER_SECRET_TOKEN' ,  url = 'https://example.com' ,  type = 'GetSelectionItem' ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/updateBotEndpoints' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "url" :   'https://example.com' ,  
     "type" :   "GetSelectionItem"  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                حذف keypad
               
              
                متد: editChatKeypad 
                ورودی 
               
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/editChatKeypad'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "chat_keypad_type" :  "Remove" 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "chat_keypad_type" :  "Remove" , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /editChatKeypad' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  remove_chat_keypad 
remove_chat_keypad ( token = 'SUPER_SECRET_TOKEN' ,  chat_id = 'CHAT_ID' ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/editChatKeypad' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "chat_keypad_type" :   "Remove"  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                ویرایش keypad
               
              
                متد: editChatKeypad 
                ورودی 
               
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/editChatKeypad'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "chat_keypad_type" :  "New" , 
            "chat_keypad" :  { 
                "rows" :  [ 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "100" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Add Account" 
                            } 
                        ] 
                    }, 
                    { 
                        "buttons" :  [ 
                            { 
                                "id" :  "101" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Edit Account" 
                            }, 
                            { 
                                "id" :  "102" , 
                                "type" :  "Simple" , 
                                "button_text" :  "Remove Account" 
                            } 
                        ] 
                    } 
                ], 
                "resize_keyboard" :  true , 
                "on_time_keyboard" :  false 
            } 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
url  =  f "https://botapi.rubika.ir/v3/ { token } /editChatKeypad" 
data  =  { 
    "chat_id" :  chat_id , 
    "chat_keypad_type" :  "New" , 
    "chat_keypad" :  { 
        "rows" :  [ 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "100" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Add Account" 
                    } 
                ] 
            }, 
            { 
                "buttons" :  [ 
                    { 
                        "id" :  "101" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Edit Account" 
                    }, 
                    { 
                        "id" :  "102" , 
                        "type" :  "Simple" , 
                        "button_text" :  "Remove Account" 
                    } 
                ] 
            } 
        ], 
        "resize_keyboard" :  True , 
        "on_time_keyboard" :  False 
    } 
} 
headers  =  { 
    'Content-Type' :  'application/json' 
} 
response  =  requests . post ( url ,  headers = headers ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  edit_chat_keypad 
from  rubika_bot.models  import  Keypad ,  KeypadRow ,  Button 
b1  =  Button ( id = '100' ,  type = 'Simple' ,  button_text = 'Add Account' ) 
b2  =  Button ( id = '101' ,  type = 'Simple' ,  button_text = 'Edit Account' ) 
b3  =  Button ( id = '102' ,  type = 'Simple' ,  button_text = 'Remove Account' ) 
keypad  =  Keypad ( 
    rows = [ 
        KeypadRow ( buttons = [ b1 ]), 
        KeypadRow ( buttons = [ b2 ,  b3 ]) 
    ], 
    resize_keyboard = True , 
    on_time_keyboard = False 
) 
edit_chat_keypad ( token = 'SUPER_SECRET_TOKEN' ,  chat_id = 'CHAT_ID' ,  chat_keypad = keypad ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/editChatKeypad' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
       "chat_id" :   chat_id ,  
       "chat_keypad_type" :   "New" ,  
       "chat_keypad" :   {  
         "rows" :   [  
           {  
             "buttons" :   [  
               {  
                 "id" :   "100" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Add Account"  
               }  
             ]  
           },  
           {  
             "buttons" :   [  
               {  
                 "id" :   "101" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Edit Account"  
               },  
               {  
                 "id" :   "102" ,  
                 "type" :   "Simple" ,  
                 "button_text" :   "Remove Account"  
               }  
             ]  
           }  
         ],  
         "resize_keyboard" :   true ,  
         "on_time_keyboard" :   false  
       }  
     })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                دریافت فایل
               
              
              
              
              
              
              
                ارسال فایل
               
              
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/sendFile'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "chat_id" :  " {chat_id} " , 
            "file_id" :  " {file_id} " , 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "chat_id" :  chat_id , 
    "file_id" :  file_id , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /sendFile' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  sendFile 
send_sticker ( 
    token = 'SUPER_SECRET_TOKEN' , 
    chat_id = 'CHAT_ID' , 
    file_id = 'FILE_ID' , 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/sendFile' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "chat_id" :   chat_id ,  
     "file_id" :   file_id ,  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                آپلود فایل
               
              
                متد: requestSendFile 
                ورودی 
               
              
              
              
              
                
                  مثال
                  
                     
                    
                      cURL Python NodeJs 
                    
                    
                      
                        
                        
                          
                            curl  -- location  - g  -- request  POST  'https://botapi.rubika.ir/v3/{token}/requestSendFile'  \
        -- header  'Content-Type: application/json'  \
        -- data - raw  '{ 
            "type" :  " Image " , 
        } ' 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            import  requests 
data  =  { 
    "type" :  "Image" , 
} 
url  =  f 'https://botapi.rubika.ir/v3/ { token } /requestSendFile' 
response  =  requests . post ( url ,  data = data ) 
print ( response . text ) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            from  rubika_bot.requests  import  requestSendFile 
send_sticker ( 
    token = 'SUPER_SECRET_TOKEN' , 
    type = "Image" , 
) 
 
                           
                         
                        
                       
                      
                        
                        
                          
                            var   request   =   require ( 'request' );  
var   options   =   {  
   'method' :   'POST' ,  
   'url' :   'https://botapi.rubika.ir/v3/{token}/requestSendFile' ,  
   'headers' :   {  
     'Content-Type' :   'application/json'  
   },  
   body :   JSON . stringify ({  
     "type" :   "Image" ,  
   })  
};  
request ( options ,   function   ( error ,   response )   {  
   if   ( error )   throw   new   Error ( error );  
   console . log ( response . body );  
});  
 
                           
                         
                        
                       
                     
                    
                       
                    
                    
                       
                    
                   
                 
               
              
                این متد آدرسی با نام upload_url برمیگرداند که برای آپلود فایل
                از طریق درخواست POST استفاده میشود. فایل باید در بدنه (Body)
                ارسال گردد.