How to use the telegraf/markup.keyboard function in telegraf

To help you get started, weā€™ve selected a few telegraf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github N3TC4T / xrp-telegram-bot / handlers / scenes / withdraw.js View on Github external
const moment = require('moment');

// libs
const address_codec = require('ripple-address-codec');
const ripple = require('../../lib/ripple');
const logger = require('../../lib/loggin');

// constants
const v = require('../../config/vars');

const CANCEL_TEXT = 'Back šŸ”™';
const CANCEL_MENU = Markup.keyboard([[CANCEL_TEXT]])
    .resize()
    .extra();

const MAIN_MENU = Markup.keyboard([
    ['āž”ļø Send $XRP', 'šŸ“ˆ Market'],
    ['āš–ļø Balance', 'ā¬‡ļø Deposit', 'ā¬†ļø Withdraw'],
    ['šŸ”” Notificaiton', 'šŸ‘„ Contact'],
])
    .resize()
    .extra();

class WithdrawHandler {
    constructor(app, db, stage) {
        this.app = app;
        this.db = db;
        this.ctx = null;
        this.stage = stage;
    }

    Cancel(ctx) {
github ironsoul0 / headhunter / src / bot / index.js View on Github external
bot.context.gameStarted = gameStarted;

    const initiallyEnded = await Setting.findOne({
      setting: "gameEnded",
    });
    const gameEnded = initiallyEnded ? initiallyEnded.value : false;
    console.log(`Setting loaded: gameEnded == ${gameEnded}`);
    bot.context.gameEnded = gameEnded;
  };

  await initSettings();

  bot.use(session());
  bot.use(stage.middleware());

  bot.context.mainMenu = Markup.keyboard([
    ["šŸ¦ Become a Hunter", "šŸ”„ TOP Hunters"],
    ["šŸ“¢ Personal Info", "šŸ“ž Feedback"],
    ["šŸ¤³ Message the Aim", "šŸ‘ Message the Hunter"],
    ["šŸ‘¹ Catch the Aim"],
  ])
    .resize()
    .extra();

  commands.forEach(commandHandler => {
    commandHandler(bot);
  });

  bot.catch(error => {
    console.log(
      "Telegraf error",
      error.response,
github albertincx / formatbot1 / src / api / routes / format / keyboards.js View on Github external
function start() {
  const replyMarkup = Markup.keyboard([
    [BUTTONS.hello.label],
    [BUTTONS.hide.label],
  ]);
  return Extra.markup(replyMarkup);
}
github N3TC4T / xrp-telegram-bot / handlers / scenes / feed_notify.js View on Github external
Menu(ctx) {
        ctx.replyWithHTML(
            'Notifications Settings',
            Markup.keyboard([['ā„¹ļø Wallet Notify', 'ā„¹ļø Feed Notify'], [CANCEL_TEXT]])
                .resize()
                .extra(),
        );
        ctx.deleteMessage().catch(e => {});
        ctx.scene.leave();
    }
github ironsoul0 / headhunter / src / bot / scenes / askMessageForHunter.js View on Github external
askMessageForHunter.enter(ctx => {
  ctx.reply(
    "Seems you a risky person! Just send me the message for your hunter šŸ‘ŗ",
    Markup.keyboard([["ā—€ļø Go Back"]])
      .resize()
      .extra()
  );
});
github ironsoul0 / headhunter / src / bot / commands / feedback.js View on Github external
bot.hears("šŸ“ž Feedback", async ctx => {
    ctx.reply(
      "What do you think? Any thoughts are welcome šŸ¤—",
      Markup.keyboard([["ā—€ļø Go Back"]])
        .resize()
        .extra()
    );
    return ctx.scene.enter("askFeedback");
  });
github KeithPatrick5 / honktipbot / src / handlers / textHandler.js View on Github external
const privateChat = ctx => {
  ctx.reply(
    `Hello ${ctx.from.first_name} this is Honk tip bot.\nSee /help for more info.`,
    Markup.keyboard([
      ["/balance", "/help"],
      ["/deposit", "/withdraw"]
    ])
      .oneTime()
      .resize()
      .extra()
  );
};
github N3TC4T / xrp-telegram-bot / handlers / scenes / wallet_notify.js View on Github external
Menu(ctx) {
        ctx.replyWithHTML(
            'Wallet Notify Settings',
            Markup.keyboard([['āž• Add Wallet', 'šŸ“‡ Manage Wallets'], [CANCEL_TEXT]])
                .resize()
                .extra(),
        );
        ctx.deleteMessage().catch(e => {});
        ctx.scene.leave();
    }
github thedevs-network / tgdr / server / bot / rate.ts View on Github external
`<code>@${username}</code> does not exist in our database.\n\n` +
        'You can submit it here:\n' +
        'šŸŒ https://tgdr.io'
    );
  }

  const userState = {
    rate: { entry, username },
  };

  await redis.set(getDbName(id), JSON.stringify(userState), 'EX', 60 * 60);

  return ctx.replyWithHTML(
    `You are going to rate the <code>@${username}</code>.\n\n` +
      'Please select your feedback.',
    Markup.keyboard([['šŸ’™', 'šŸ‘Ž']])
      .oneTime()
      .resize()
      .extra()
  );
};