bot.catch(async (error) => {
console.log(`globally problems with bot => ${error}`)
})
const getBackKeyboard = () => {
const backKeyboard = Markup.keyboard([buttons.back]);
return backKeyboard.resize();
ctx.scene.leave(); -> ?
}
require('dotenv').config()
const c = require('ansi-colors');
const { Scenes } = require('telegraf')
const fs = require('fs');
const User = require('./../models')
// const sequelize = require('sequelize');
const auth = new Scenes.WizardScene('auth', async (ctx) => {
try {
if (!ctx?.from) return;
const username = ctx.from.username || ctx.from.id;
const user = await User.findOrCreate({
where: {
id: ctx.from.id,
},
defaults: {
id: ctx.from.id,
username,
}
})