Ejemplo n.º 1
0
def _update_handler(bot: Gap, update):  # bot: Methods;
    if update['type'] == 'text':
        bot.send_text(chat_id=update['chat_id'], text=update['data'])
Ejemplo n.º 2
0
        "name": "test_bc",
        "type": "inbuilt",
        "value": "barcode",
        "label": "Scan barcode"
    }, {
        "name": "test_qr",
        "type": "inbuilt",
        "value": "qrcode",
        "label": "Scan qr-code"
    }, {
        "name": "agree",
        "type": "checkbox",
        "label": "I agree"
    }, {
        "type": "submit",
        "label": "Save"
    }]
    app.send_text(
        chat_id=
        target_id,  # https://developer.gap.im/doc/botplatform#chatId-description
        text=text,
        reply_keyboard=
        reply_keyboard,  # https://developer.gap.im/doc/botplatform#reply_keyboard-description
        inline_keyboard=
        inline_keyboard,  # https://developer.gap.im/doc/botplatform#inline_keyboard-description
        reply_form=
        form,  # https://developer.gap.im/doc/botplatform#form-description
    )

# https://developer.gap.im/doc/botplatform#method-send-text
Ejemplo n.º 3
0
from gapbot import Gap  # import library;

app = Gap(bot_token='your_bot_token')  # instance of Main Class;
# if you need use bot parameters you must set bot_token;

if __name__ == '__main__':  # If you are running this module as the main program;
    target_id = 000000  # whose to be send text to him;
    text = "GapBot SendText"
    new_text = 'GapBot SendEditedText'
    msg = app.send_text(
        chat_id=
        target_id,  # https://developer.gap.im/doc/botplatform#chatId-description
        text=text,
    )
    app.edit_message(
        chat_id=target_id,
        message_id=msg.json()['id'],
        new_text=new_text,
    )

# https://developer.gap.im/doc/botplatform#method-edit-message