Package: rubika-bot
Rubika has created APIs for you that you can use to build your own "bot".Requirementspython3.8 +Installation$ pip install rubika-botSteps of useFirst you have to create a bot for yourself withBot Father.Hold the token it gives you and use it the following methods.DescriptionAfter you have built your bot in Bot Father and defined your endpoint, the system will send any event or message sent to your bot to your Endpoint in one of the following two ways.Endpoint/receiveUpdateEndpoint/receiveInlineMessagereceiveUpdateWhenever a usersends a messageor taps on akeypad, you will receive this type of request.sample body :{"inline_message":{"sender_id":"u0QFtn01dd26d72abc5c77b8e116cd79","text":"custom text","location":null,"aux_data":{"start_id":null,"button_id":"61f674bd0abcd57b5b816a7c"},"message_id":"204216801381244279","chat_id":"b0QFtabc1I02214b529f1d60c9ce5b08"}}sender_id:Unique identifier assigned to the user.text:The text of the sent button.button_id:The ID you set for the button.message_id:The unique identifier assigned to the message.chat_id:Unique identifier for the conversation between the user and the bot(you must continue to use this identifier.)receiveInlineMessageWhenever the user taps on theinline keypad, you receive this type of request.sample body :{"update":{"type":"NewMessage","chat_id":"b0QFtn0C1I022abcd29f1d60c9ce5b08","new_message":{"message_id":204215121115944300,"text":"custom text","time":"1643122902","is_edited":false,"sender_type":"User","sender_id":"u0QFtn0abcded727585c77b8e116cd79","aux_data":{"start_id":null,"button_id":"61f674bd0abcd57b5b816a7c"}}}}type:can beNewMessage,StartedBot,StoppedBotand ....text:The text of the sent button.button_id:is the identifier you set for the button.message_id:The unique identifier assigned to the message.chat_id:Unique identifier for the conversation between the user and the bot(you must continue to use this identifier.)UsageGet Your Bot Informationfromrubika_bot.requestsimportget_mefromrubika_bot.modelsimportBotbot:Bot=get_me(token=...)Send Start Keypadfromrubika_bot.requestsimportsend_messagefromrubika_bot.modelsimportKeypad,KeypadRow,Buttonb1=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=...,chat_id=...,text='Welcome',chat_keypad_type='New',chat_keypad=keypad)Send Inline Keypadfromrubika_bot.requestsimportsend_messagefromrubika_bot.modelsimportKeypad,KeypadRow,Buttonb1=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=...,chat_id=...,text='Welcome',inline_keypad=keypad)Send Messagefromrubika_bot.requestsimportsend_messagesend_message(token=...,chat_id=...,text='Hello World',)Send Pollfromrubika_bot.requestsimportsend_pollsend_poll(token=...,chat_id=...,question='Do you have any question?',options=['yes','no'])Send Locationfromrubika_bot.requestsimportsend_locationsend_location(token=...,chat_id=...,latitude='35.759662741892626',longitude='51.4036344416759')Send Contactfromrubika_bot.requestsimportsend_contactsend_contact(token=...,chat_id=...,first_name='Ali',last_name='Rn',phone_number='09038754321')Get Chat Informationfromrubika_bot.requestsimportget_chatfromrubika_bot.modelsimportChatchat:Chat=get_chat(token=...,chat_id=...,)Get Last 10 Updatesfromrubika_bot.requestsimportget_updatesfromrubika_bot.modelsimportUpdateupdates,_=get_updates(token=...,limit=10,)Forward Messagefromrubika_bot.requestsimportforward_messageforward_message(token=...,from_chat_id=...,message_id=...,to_chat_id=...)Edit Message Textfromrubika_bot.requestsimportedit_message_textedit_message_text(token=...,chat_id=...,message_id=...,text='New Message Text')Edit Inline Keypadfromrubika_bot.requestsimportedit_message_keypadfromrubika_bot.modelsimportButton,Keypad,KeypadRowb1=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=...,chat_id=...,message_id=...,inline_keypad=new_keypad)Delete Messagefromrubika_bot.requestsimportdelete_messagedelete_message(token=...,chat_id=...,message_id=...,)TODO:Change the required python version from 3.10 to 3.8