const { Telegraf, Scenes, session } = require('telegraf');
const stage = new Scenes.Stage();
const express = require('express');
const app = express();
const bot = new Telegraf('6364012404:AAHx0GE4LnlHyPnhjLBF4q_g-9upzjto68k');
bot.use(session());
bot.use(stage.middleware());
let admin = 5626151907;
app.get('/', (req, res) => {
res.send('Hello World!');
});
// FOR START CODE \\
bot.start(async ctx => {
const userId = ctx.message.chat.id;
const msg = ctx.message.text.split(" ");
const firstName = ctx.message.chat.first_name;
const lastName = ctx.message.chat.last_name;
const userName = ctx.message.chat.username;
let newUser = false;
if (!newUser) {
await ctx.telegram.sendMessage(admin, `
<b>โ New User Joined the Bot</b>
<b>๐ค FirstName:</b> ${firstName}
<b>โ๏ธ LastName:</b> ${lastName}
<b>๐ถ UserName:</b> @${userName}
<b>๐ User Id:</b> <code>${userId}</code>
`, {
parse_mode: 'HTML'
});
if (msg[1]) {
let upline = msg[1];
if (upline != undefined && upline != userId) {
await ctx.telegram.sendMessage(upline, "โ* You Just Got a New Referral* " + userId, {
parse_mode: 'markdown'
});
}
}
}
await ctx.replyWithPhoto({
url: "https://i.ibb.co/sCdFq91/IMG-1351.jpg"
}, {
caption: `
<b>๐ Hello </b>${firstName},
<b>๐ฅWelcome to TRON Games Bot๐ฅ</b>
โจAUTO-PAYMENTS BOTโจ
<i>This bot lets you earn Tron TRX by simples gaming.</i>
-> โจ Lottery
-> ๐ฐ Bet
-> ๐ฒ Dice
-> โฝ๏ธ Football
-> ๐ Twister
<b>Minimum deposit:</b> 1 TRX
<i>๐ Please join our spot channel to continue more details and to continue to our Bot</i>
`,
parse_mode: "HTML",
reply_markup: {
inline_keyboard: [
[
{ text: "๐๐ Join Our Channel ๐๐", url: "https://t.me/cartmoreelogs" }
],
[
{ text: "โ
Continue to Bot", callback_data: "joinbot" }
]
]
}
});
});
// FOR MENU CODE \\
function mainMenu(ctx) {
let userDetails;
if (ctx.callbackQuery) {
userDetails = ctx.callbackQuery.from;
} else {
userDetails = ctx.message.chat;
}
const userId = userDetails.id;
let botName = ctx.botInfo.username;
const firstName = userDetails.first_name;
ctx.telegram.sendMessage(userId, `
<b>๐ Welcome To @${botName}
Join us now in making money and earn 10x your betting guaranteed.</b>
<i>๐ Deposit now to get started</i>`, {
reply_markup: {
keyboard: [
[
{ text: '๐ค Account Information' }
],
[
{ text: '๐ฅ Add Funds' },
{ text: '๐งฎ Game Spot' },
{ text: '๐ค Withdraw Funds' }
],
[
{ text: '๐ Free Bonus' },
{ text: '๐ผ Set wallet' },
{ text: '๐จโ๐จโ๐งโ๐ฆ Referral' }
],
[
{ text: 'โ Help' },
{ text: '๐ Terms And Conditions' },
{ text: '๐ Statistics' }
]
],
resize_keyboard: true
},
parse_mode: 'HTML'
});
}
// FOR ACCOUNT BALANCE BUTTON \\
bot.hears('๐ค Account Information', ctx => {
const userId = ctx.message.chat.id;
const name = ctx.message.chat.first_name;
const balance = 0;
ctx.reply(`
<b>Account Information
๐คด Name:</b> ${name}
<b>๐ Acct ID:</b> ${userId}
<b>๐ฐ Balance:</b> ${balance} <b>TRX</b>
<i>๐ Deposit now!!!</i>`, {
parse_mode: 'HTML'
});
});
// FOR HELP BUTTON \\
bot.hears('โ Help', ctx => {
const userId = ctx.message.chat.id;
const firstName = ctx.message.chat.first_name;
ctx.telegram.sendMessage(userId, `
1.) If You Want To Deposit Then Click On <b>๐ฅ Add Funds</b>
2.) If You Want To Withdraw Then Click On <b>๐ค Withdraw Funds</b>
3.) If you want to set a wallet address, click On <b>๐ผ Set wallet</b>
4.) To start playing and make a x10, click On <b>๐งฎ Game Spot</b>
5.) To receive free bonuses every day and earn more, Click On <b>๐ Free Bonus</b>
6.) If you want to earn much more by inviting friends, Click On <b>๐จโ๐จโ๐งโ๐ฆ Referral</b>
7.) To know the statistics of the Bot, Click On <b>๐ Statistics</b>
8.) To know the account information, Click On <b>๐ค Account Information</b>
8.) If you want to see our terms and conditions, Click On <b>๐ Terms And Conditions</b>
9.)Transparency with our community. Payments Channel: @TronGamesBotPayments
10.) For contacts and questions write to us at: ๐<b>@DogeClick_ORG</b> or Visit our website: www.dogeclick.org - <b>Channel:</b> @DogeClickUpdatesNews
`,{
parse_mode: "HTML"
});
});
// FOR REFERRAL BUTTON \\
bot.hears('๐จโ๐จโ๐งโ๐ฆ Referral', ctx => {
const userId = ctx.message.chat.id;
const botName = ctx.botInfo.username;
const total = 0;
ctx.telegram.sendMessage(userId, `
<b>๐ค Earn 0.025 Tron TRX for New referral
๐ฅ Your Total Downlines
${total} Downlines
โ
Ref Link to share link with your friends: https://t.me/${botName}?start=${userId}</b>`, {
parse_mode: 'HTML'
});
});
// FOR STATISTICS BUTTON \\
bot.hears('๐ Statistics', ctx => {
const userId = ctx.message.chat.id;
const botName = ctx.botInfo.username;
// date
const date = new Date();
// total users,deposits and withdraws
const totalUser = 0;
const totalDeposits = 0;
const totalWithdraws = 0;
// lotteries
const totalLotteryWins = 0;
const totalLotteryLoss = 0;
// total dices
const totalDiceWins = 0;
const totalDiceLoss = 0;
// football stats
const totalBallWins = 0;
const totalBallLoss = 0;
// twister totals
const totalTwisterWins = 0;
const totalTwisterLoss = 0;
ctx.telegram.sendMessage(userId, `
๐ฅ<u> Full Statics Of Bot </u>๐ฅ
<b>โ Bot Uptime: 99.99%
๐ Date Time:</b><i> ${date}</i>
<b>๐ค Total Users:</b> ${totalUser}
<b>๐ฅ Total Deposits:</b> ${totalDeposits} TRX
<b>๐ค Total Withdraws:</b> ${totalWithdraws} TRX
<b>------------------------------------------------</b>
โจ <u>Total Lotteries</u>
๐ค Total Lotteries Winned : ${totalLotteryWins}
๐ฅ Total Lotteries Losed : ${totalLotteryLoss}
<b>---------------------------</b>
๐ฒ<u> Dice Stats</u>
๐ค Total Dice Winned : ${totalDiceWins}
๐ฅ Total Dice Losed : ${totalDiceLoss}
<b>---------------------------</b>
โฝ๏ธ<u> FootBall Stats</u>
๐ค Total FootBall Winned : ${totalBallWins}
๐ฅ Total FootBall Losed : ${totalBallLoss}
<b>---------------------------</b>
๐<u> Twister Stats</u>
๐ค Total Twister Winned : ${totalTwisterWins}
๐ฅ Total Twister Losed : ${totalTwisterLoss}`, {
parse_mode: "HTML"
});
});
// FOR TERMS AND CONDITIONS BUTTON \\
bot.hears('๐ Terms And Conditions', ctx => {
ctx.telegram.sendMessage(ctx.message.chat.id, `
<b>๐ <u>Terms And Conditions </u></b>
<b>๐ข Games In This Maybe Be Addictive And Have Righ Risk Of Money Loss
Please Use It At Your Own Risk In Case Of Any Money Loss We Are Not Responsible.</b>
<i>To maintain our services, a 5% commission will be charged on all deposits and withdrawals.</i>`, {
reply_markup: {
inline_keyboard: [
[
{
text: 'โ
Verify', callback_data: 'verifyterms'
},
{
text: 'โ Decline', callback_data: 'declineterms'
}
]
]
},
parse_mode: "HTML"
});
});
// FOR SET WALLET BUTTON \\
bot.hears('๐ผ Set wallet', ctx => {
const chatId = ctx.message.chat.id;
let wallet;
if (!wallet) {
wallet = 'โ Not set'
}
ctx.telegram.sendMessage(chatId, "โ* Your Wallet:* `" + wallet + "`", {
reply_markup: {
inline_keyboard: [
[
{ text: 'โ๏ธ Set / Change Wallet', callback_data: "setwallet" }
]
]
},
parse_mode: 'markdown'
});
});
// FOR BONUS BUTTON \\
bot.hears('๐ Free Bonus', ctx => {
function canRun() {
var last_run_at = 1694142786854;
if (!last_run_at) { return true }
var minutes = (Date.now() - last_run_at) / 1000 / 60;
var minutes_in_day = 48 * 60
var next = minutes_in_day - minutes
var wait_hours = Math.floor(next / 60)
next -= wait_hours * 60
var wait_minutes = Math.floor(next)
var seconds = Math.floor((next - wait_minutes) * 60)
if (minutes < minutes_in_day) {
ctx.reply("*๐ You have already received a bonus Today\n\nโถ๏ธ Come Back After โณ* " + wait_hours + " *h* " + wait_minutes + " *m* "
+ seconds + " *s*", {
parse_mode: 'markdown'
});
return
}
return true;
}
if (!canRun()) { return }
//save current time User.setProperty("last_run_at", Date.now(), "integer");
ctx.reply("๐ Congrats , you Received 0.25 TRX ๐");
});
// FOR WITHDRAWAL BUTTON \\
bot.hears('๐ค Withdraw Funds', ctx => {
const balance = 2;
const wallet = "tffgggvv";
const minimum = 1
if (balance < minimum) {
ctx.reply("_โ You Need Minimum " + minimum + " TRX To Withdraw_", {
parse_mode: 'Markdown'
});
} else if (wallet == undefined || !wallet) {
ctx.reply("_โ Wallet not set_", {
parse_mode: 'Markdown'
});
} else {
const withdraw = new Scenes.BaseScene("withdraw");
withdraw.enter( ctx => {
ctx.reply("_โก๏ธ Send Trx Amount to Withdraw_", {
parse_mode: 'markdown'
});
});
withdraw.on('text', ctx => {
ctx.scene.leave();
ctx.reply("Wait Processing...");
////// Rest for withdrawal
});
stage.register(withdraw);
ctx.scene.enter("withdraw");
}
});
// FOR GAMES STORE BUTTON \\
bot.hears('๐งฎ Game Spot', ctx => {
ctx.replyWithPhoto({
url: "https://i.ibb.co/Bsf4kB4/IMG-1352.jpg"
},{
caption: "๐ <u>Welcome to our Game Center!</u>\n\n๐ฎ Here, you can enjoy a variety of exciting games to test your luck and skills.\n๐ Dive into the thrill of our games, including Lottery, Dice, Football, and Twister.\nโ๏ธ Get ready for hours of fun and the chance to win big prizes.\n\n<b>๐ฅ Let the games begin! </b>๐ฅ",
parse_mode: "HTML",
reply_markup: {
keyboard: [
[
{
text: 'โจ Lottery'
},
{
text: '๐ฒ Dice'
}
],
[
{
text: 'โฝ FootBall'
},
{
text: '๐ Twister'
}
],
[
{
text: 'Back to home โฉ๏ธ'
}
]
],
resize_keyboard: true
}
});
});
// FOR BACK BUTTON ON GAME CENTER \\
bot.hears('Back to home โฉ๏ธ', ctx => {
mainMenu(ctx);
});
// FOR ALL GAMES BUTTON HERE \\
// ------> FOR LOTTERY BUTTON <------- \\
bot.hears('โจ Lottery', ctx => {
let balance = parseFloat(2);
const mini = 1;
if (balance < mini){
ctx.reply("_โ To Participate In Lottery You Must Have "+mini+" TRX_.",{
parse_mode: 'markdown'
});
}else{
const lotteryAmount = new Scenes.BaseScene("lotteryAmount");
lotteryAmount.enter( ctx => {
ctx.reply("โก๏ธ _Enter TRX Amount to Participate in the Lottery_.",{
parse_mode: 'markdown'
});
});
lotteryAmount.on('text', ctx => {
const amount = parseFloat(ctx.message.text);
if (isNaN(amount)){
ctx.reply("_โ Enter a Valid Amount_.",{
parse_mode: 'markdown'
});
}else if (balance < amount){
ctx.scene.leave();
ctx.reply("_โ You Do Not Have Enough Balance to Play_.",{
parse_mode: 'markdown'
});
}else{
ctx.scene.leave();
///////////// after amount validated asking for guess number////
const lotteryReturn = amount*2;
const lotteryGuess = new Scenes.BaseScene("lotteryGuess");
lotteryGuess.enter( ctx => {
ctx.reply("โ * Lottery Amount:* "+amount+" _TRX_\n\nโก๏ธ You Will Get "+lotteryReturn+" *TRX* If You Win\n๐ฅ _ Send 5 Digit Number From 1-5_.",{
parse_mode: 'markdown'
});
});
lotteryGuess.on('text', ctx => {
const guessGame = ctx.message.text;
if (isNaN(guessGame)){
ctx.reply("_โ Please Enter a Valid Numbers_.",{
parse_mode: 'markdown'
});
}else if (guessGame.length > 5){
ctx.reply("_โ Please Enter a Number only 5 lengths_.",{
parse_mode: 'markdown'
});
}else if (guessGame.includes("6")||guessGame.includes("7")||guessGame.includes("8")||guessGame.includes("9")||guessGame.includes("0")){
ctx.reply("_โ Please Enter a Number Only From 1 - 5_.",{
parse_mode: 'markdown'
});
}else{
ctx.scene.leave();
balance -= amount;
ctx.replyWithMarkdown("๐ช _Validating your Game ... 3s_");
setTimeout(function (){
ctx.replyWithMarkdown("_3_");
},1000);
setTimeout(function (){
ctx.replyWithMarkdown("_2_")
},2000);
setTimeout(function (){
ctx.replyWithMarkdown("_1_")
},3000);
setTimeout(function (){
let c = "";
let arr = ["1", "2", "3", "4", "5"];
let i;
function getRandomItem(arr) {
var randomIndex = Math.floor(Math.random() * arr.length);
var item = arr[randomIndex];
return item;
}
for (i = 0; i < arr.length; i++) {
var result = getRandomItem(arr);
if (!c.includes(result)) {
c += result;
} else {
i = i - 1;
continue;
}
}
if (guessGame === c) {
ctx.reply("๐ WoHoo You Win *"+lotteryReturn+"* TRX");
balance += lotteryReturn;
} else {
ctx.reply("๐ญ* Opps*, It's "+c+", _You Lose_ *"+amount+"* _TRX_",{
parse_mode: "markdown"
});
}
},4000);
}
});
stage.register(lotteryGuess);
ctx.scene.enter("lotteryGuess");
/////// end of it \\\\\\\\\\\\\
}
});
stage.register(lotteryAmount);
ctx.scene.enter("lotteryAmount");
}
});
// ------> FOR DICE BUTTON <------- \\
bot.hears('๐ฒ Dice', ctx => {
let balance = 5;
const mini = 3;
const diceReturn = 5;
const diceGame = new Scenes.BaseScene("diceGame");
diceGame.enter( ctx => {
ctx.telegram.sendMessage(ctx.chat.id,`
โ Note: *This game cost ${mini} trx to play and if you win you will get ${diceReturn} trx total else ๐ช*
๐ฒ_ Enter a random number between 1 to 6 _๐ฒ`, {
parse_mode: 'markdown',
reply_markup: {
keyboard: [
[
{text: '1'},
{text: '2'},
{text: '3'}
],
[
{text: '4'},
{text: '5'},
{text: '6'}
],
[
{text: '๐ฒ Dice'},
{text: 'Back to home โฉ๏ธ'}
]
],
resize_keyboard: true
}
});
});
diceGame.on('text', ctx => {
const guessDice = ctx.message.text;
if (balance < mini){
ctx.replyWithMarkdown("*๐ข You have to own at least "+mini+" trx* ...\n_This game cost "+mini+" trx to play!_");
ctx.scene.leave();
}else if (guessDice > 0 && guessDice <= 6){
balance -= 3;
ctx.scene.leave();
const sentDice = new Scenes.BaseScene("sentDice");
sentDice.enter(async ctx => {
await ctx.replyWithMarkdown("โก๏ธ *Guides:* _Click on the below _*Dice (๐ฒ) *_to send Your Dice_");
ctx.sendDice();
});
sentDice.on('dice', ctx => {
ctx.scene.leave();
const result = ctx.message.dice.value;
ctx.replyWithMarkdown('_๐ช Validating your Dice Result_');
setTimeout( function (){
if (parseFloat(result) === parseFloat(guessDice)) {
ctx.replyWithMarkdown('*๐ Congratulations, you have received 5 TRX for winning*\n play again ๐');
balance += 5;
} else {
ctx.replyWithMarkdown('*๐ธ Luck for the next!*');
ctx.replyWithMarkdown('๐ช *The correct number was ' + result + '*');
}
},3000);
});
stage.register(sentDice);
ctx.scene.enter("sentDice");
}else{
ctx.replyWithMarkdown("*โจ This is a dice game.*\nโซ๏ธ_Enter numbers 1 through 6 only._");
}
});
stage.register(diceGame);
ctx.scene.enter("diceGame");
});
// ------> FOR DICE BUTTON <------- \\
bot.hears('โฝ FootBall', ctx => {
ctx.telegram.sendMessage(ctx.message.chat.id, `๐ฟ *Here you can play football and win more trx
๐ฅThe rules are simple:
If Result == 6,4,2 You win 2 TRX
If Result == 5,3,1 You will loose 1 Trx Bet*
_โฝ FootBall Game Play Price is Only 1 TRX Per Ball Played_`, {
parse_mode: 'markdown',
reply_markup: {
inline_keyboard: [
[
{
text: 'Play โฝ๏ธ', callback_data: 'startball'
}
],
[
{
text: 'Back to Home',callback_data: 'backtohome'
}
]
]
}
});
});
// ------> FOR TWISTER BUTTON <------- \\
bot.hears('๐ Twister', ctx => {
ctx.telegram.sendMessage(ctx.chat.id, " ๐ To win, Get a number higher than *5250* \n\n_Select amount to bet with_", {
parse_mode: 'markdown',
reply_markup: {
inline_keyboard: [
[
{
text: "๐ 1 TRX Twister",
callback_data: "/lucky1"
}
],
[
{
text: "๐ 2 TRX Twister",
callback_data: "/lucky2"
}
],
[
{
text: "๐ 5 TRX Twister",
callback_data: "/lucky5"
}
]
]
}
});
});
// ALL GAMES BUTTON FINISH THANK GOD \\
// ALL CALLBACK QUERIES \\
bot.on('callback_query', async ctx => {
const userId = ctx.callbackQuery.from.id;
const callback = ctx.callbackQuery.data;
if (callback === "verifyterms") {
ctx.answerCbQuery();
ctx.editMessageText("*โ
Now You Can Use Bot Now*", {
parse_mode: "markdown"
});
} else if (callback === "declineterms") {
ctx.answerCbQuery();
ctx.editMessageText("*โ Some Permissions Declined*", {
parse_mode: "markdown"
});
} else if (callback === "joinbot") {
const member = await ctx.telegram.getChatMember("@cartmoreelogs", userId);
if (member.status === "left") {
ctx.answerCbQuery("โ ๏ธ Please join the Channel");
} else {
ctx.answerCbQuery("๐ฅ Welcome to the Bot");
await ctx.deleteMessage();
mainMenu(ctx);
}
}else if (callback === "setwallet") {
const walletScene = new Scenes.BaseScene("walletScene");
walletScene.enter(ctx => {
ctx.editMessageText(`
<b>๐ Enter your TRX wallet address below and it will be saved for all future withdrawals.</b>
<i>You can still change your wallet address later on.</i>`,{
parse_mode: 'HTML'
});
});
walletScene.on('text', ctx => {
const msg = ctx.message.text;
if (msg.startsWith("T") && msg.length > 30) {
ctx.reply("*โ
TRX Address Set To:* `"+ctx.message.text+"`",{
parse_mode: 'markdown',
reply_to_message_id: ctx.message.message_id
});
ctx.scene.leave();
}else{
ctx.reply("โ ๏ธ _Please Send a Valid TRX Address_", {
parse_mode: 'markdown'
});
}
});
stage.register(walletScene);
ctx.scene.enter('walletScene');
}else if (callback === "startball"){
ctx.answerCbQuery();
let balance = 1;
const mini = 1;
if (balance < mini){
ctx.editMessageText("*โ Insufficient Balance*,_ You have only "+balance+" TRX_",{
parse_mode: 'markdown'
});
}else{
ctx.deleteMessage();
const result = Math.floor(Math.random() * 6) +1;
ctx.reply("โฝ๏ธ");
setTimeout(async function(){
await ctx.reply("Game result: "+result);
if (result % 2 === 0) {
ctx.reply("You won the game +2 TRX");
balance += 2;
} else {
balance -= 1;
ctx.reply("You lost the game -1 TRX");
return;
}
},1000);
return}
} else if (callback === "/lucky1" || callback === "/lucky2" || callback === "/lucky5"){
ctx.answerCbQuery();
let balance = 6;
const wish = String(callback)[6];
const amount = parseFloat(wish);
if (balance < amount){
ctx.editMessageText("*โ ๏ธ Not Enough Balance Please Fund Your Wallet*.\n\n_You Need Atleast "+amount+" TRX_.", {
parse_mode: 'markdown'
});
}else{
const min = 0;
const max = 7190;
const real = Math.floor(Math.random() * (max - min + 1)) + min;
if (parseFloat(real) > parseFloat(5250)){
ctx.editMessageText("โ
Number: *"+real+"* ๐ _Congratulations You Won and You received_ *"+amount+"* TRX ๐ต", {
parse_mode: 'markdown'
});
balance += amount;
}else{
ctx.editMessageText("โ "+real+" Is Less Than 5250\n๐ฅต You Lost *"+amount+" TRX*\n\n๐ _You Can Try Again To stand The chance To win More TRX_",{
parse_mode: 'markdown'
});
balance -= amount;
}
}
}else{
ctx.deleteMessage();
mainMenu(ctx);
}
});
// ALL STOP ALL THANKS TO GOD BOT BY @STARKNIL \\
/*app.post('/depo', (req, res) => {
});*/
const port = 3000;
app.listen(port, () => {
console.log(`Server Running on Port: ${port}`);
});
bot.launch();