add tg support for largefetch
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
const fetch = require("node-fetch");
|
||||
var mysql = require('mysql');
|
||||
const TelegramBot = require('node-telegram-bot-api');
|
||||
|
||||
const simCo = require('./simco-credentials');
|
||||
const tgInfo = require('./telegram-credentials');
|
||||
if (!simCo.cookie || !tgInfo.token) {
|
||||
console.error("ERR: credentials not set.")
|
||||
return;
|
||||
}
|
||||
|
||||
var connection = mysql.createConnection({
|
||||
host: 'localhost',
|
||||
user: 'simcompanies',
|
||||
password: '',
|
||||
database: 'simcompanies'
|
||||
});
|
||||
const simCo = require('./simco-credentials');
|
||||
const tgBot = new TelegramBot(tgInfo.token, { polling: false });
|
||||
bot.sendMessage(tgInfo.debugChat, 'INF: started polling resource prices.');
|
||||
|
||||
const exchangeAPI = "https://www.simcompanies.com/api/market/";
|
||||
const resourceAPI = "https://www.simcompanies.com/api/v3/en/encyclopedia/resources/";
|
||||
@@ -76,6 +86,7 @@ const storeFullData = async marketData => {
|
||||
}
|
||||
});
|
||||
});
|
||||
bot.sendMessage(tgInfo.debugChat, 'INF: successfully stored new prices.');
|
||||
}
|
||||
|
||||
storeFullData(getFullData());
|
||||
|
||||
Reference in New Issue
Block a user