Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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,
function start() {
const replyMarkup = Markup.keyboard([
[BUTTONS.hello.label],
[BUTTONS.hide.label],
]);
return Extra.markup(replyMarkup);
}
Menu(ctx) {
ctx.replyWithHTML(
'Notifications Settings',
Markup.keyboard([['ā¹ļø Wallet Notify', 'ā¹ļø Feed Notify'], [CANCEL_TEXT]])
.resize()
.extra(),
);
ctx.deleteMessage().catch(e => {});
ctx.scene.leave();
}
askMessageForHunter.enter(ctx => {
ctx.reply(
"Seems you a risky person! Just send me the message for your hunter šŗ",
Markup.keyboard([["āļø Go Back"]])
.resize()
.extra()
);
});
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");
});
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()
);
};
Menu(ctx) {
ctx.replyWithHTML(
'Wallet Notify Settings',
Markup.keyboard([['ā Add Wallet', 'š Manage Wallets'], [CANCEL_TEXT]])
.resize()
.extra(),
);
ctx.deleteMessage().catch(e => {});
ctx.scene.leave();
}
`<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()
);
};