mirror of
https://github.com/arthur-pbty/gestion-perso.git
synced 2026-06-21 13:55:08 +02:00
bot passer sous TS
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
require('dotenv').config()
|
||||
const run = require("./fonctions/run");
|
||||
const initDB = require("./fonctions/initDB");
|
||||
|
||||
initDB();
|
||||
|
||||
const runAsync = async () => {
|
||||
if (process.env.TOKENS) {
|
||||
const tokens = process.env.TOKENS.split(',');
|
||||
Promise.all(tokens.map(token => run(token)));
|
||||
} else {
|
||||
console.error("Environment variable 'TOKENS' is not defined.");
|
||||
}
|
||||
};
|
||||
|
||||
runAsync();
|
||||
Reference in New Issue
Block a user