Noblox Error JavaScript

const Discord = require('discord.js');
const noblox = require('noblox.js');

const client = new Discord.Client();
const config = require('./config.json');

client.once('ready', () => {
    console.log('ready');
});
client.login(config.token);

client.on('message', message => {
    const placeInfo = await noblox.getPlaceInfo(8765432);
    if (message.content === ':react') {
        message.channel.send('No specified command was given');
    }
    if (message.content === ':react MemberCount') {
        message.channel.send(message.guild.memberCount);
    }
    if (message.content === ':react Visits') {
        message.channel.send(placeInfo.Name);
    }
});

The problem is here

const placeInfo = await noblox.getPlaceInfo(8765432);

Sorry for asking something js instead of lua.

1 Like

It would be useful if you gave the error.

Just glancing at the code I assume the error is because you are not using an async function but you are trying to await something.

client.on('message', async message => {
    const placeInfo = await noblox.getPlaceInfo(8765432);
    if (message.content === ':react') {
        message.channel.send('No specified command was given');
    }
    if (message.content === ':react MemberCount') {
        message.channel.send(message.guild.memberCount);
    }
    if (message.content === ':react Visits') {
        message.channel.send(placeInfo.Name);
    }
});