This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//so i made a specific file for this bot cause i will want to add some other stuff in there | |
//its a bit useless for now and could totally be in the feedbackController file | |
// also please install telegraf : https://www.npmjs.com/package/telegraf | |
const Telegraf = require('telegraf') | |
// the bot token botfather give you when creating the bot. | |
// To create the bot, just talk to @botfather and type follow the instruction | |
//After setting the name and username you can access the token | |
const bot = new Telegraf(process.env.BOT_TOKEN) | |
bot.start((ctx) => ctx.reply('Welcome')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is the file where i configure the telegram strategy for passport | |
const TelegramStrategy = require('passport-telegram-official') // i use this package | |
module.exports = function(passport){ | |
passport.use( // i say to passport | |
new TelegramStrategy({ // hey please use the TelegramStrategy | |
botToken: process.env.BOT_TOKEN // with this bot (ps the token of the bot that i keep in an environment variable | |
}, | |
async function(profile, done) { // then also do this stuff below to check if the user exist or to create it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e | |
// and @levelsio's https://gist.github.com/levelsio/a1ca0dd434b77ef26f6a7c403beff4d0 | |
// HOW TO | |
// 1) Make a new Metabase Question | |
// 2) Make the result an unique number and choose Visualization > Number | |
// 3) Write your metabase domain, your email and password below | |
const domain = "https://metabase.endpoint.com" | |
const username = "[email protected]" | |
const password = "p@ssw0rd" |