Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Key is not defined #1

Open
kiramizuky opened this issue Jul 3, 2022 · 2 comments
Open

Error: Key is not defined #1

kiramizuky opened this issue Jul 3, 2022 · 2 comments

Comments

@kiramizuky
Copy link

kiramizuky commented Jul 3, 2022

Saya menggunakan lumpia
saya mencoba samsa perssii seperti contoh:

const Keyboard = Builder.Keyboard;

const keyboard = Keyboard.make([
Key.callback('Button 1', 'action1'),
Key.callback('Button 2', 'action2'),
]).inline()

console.log(keyboard)

tapi mendapat error seperti ini

Error: Key is not defined

@banghasan
Copy link
Contributor

contoh yang mana?

@cakraawijaya
Copy link

cakraawijaya commented Nov 9, 2023

Saya menggunakan lumpia saya mencoba samsa perssii seperti contoh:

const Keyboard = Builder.Keyboard;

const keyboard = Keyboard.make([ Key.callback('Button 1', 'action1'), Key.callback('Button 2', 'action2'), ]).inline()

console.log(keyboard)

tapi mendapat error seperti ini

Error: Key is not defined


Anda bisa mencoba cara berikut ini untuk penggunaan keyboard di framework lumpia :

const button = lumpia.button;
const markup = lumpia.markup;
let keyboard = [];

bot.start(ctx => {
    keyboard = [
        [button.text('Menu1', 'menu1'), button.text('Menu2', 'menu2')],
        [button.text('Menu3', 'menu3'), button.text('Menu4', 'menu4')]
    ];

    let msg1 = 'ini contoh inline keyboard';
    let msg2 = 'ini contoh custom keyboard';
    
    ctx.replyWithHTML(msg1,{ reply_markup: markup.inlineKeyboard(keyboard) }) & 
    ctx.replyWithHTML(msg2,{ reply_markup: markup.keyboard(keyboard).resize() });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants