Guys help me please upgrade my index.js file, it written in 11.3 version, for that I get error : require('dotenv').config(); // Load .env file const axios = require('axios'); const Discord = require('discord.js'); const client = new Discord.Client();
function getPrices() { // API for price data. axios .get('https://api.genelpara.com/embed/para-birimleri.json') .then((res) => { // If we got a valid response if (res.data && res.data.USD && res.data.USD.alis) { let usdBuyPrice = parseFloat(res.data.USD.alis).toFixed(2);
// Runs when client connects to Discord. client.on('ready', () => { console.log('Logged in as', client.user.tag);
getPrices(); // Ping server once on startup // Ping the server and set the new status message every x minutes. (Minimum of 1 minute) setInterval(getPrices, Math.max(1, process.env.PING_FREQUENCY || 1) * 60 * 1000); });
// Login to Discord client.login(process.env.DISCORD_TOKEN);