SyntaxError: Unexpected Token 'const'

I am getting a error when trying to make a music bot for discord, everytime I try to start it says “unexpected token ‘const’” and then points to this

module.exports = {
  async play(song, message)

    const { PRUNING, SOUNDCLOUD_CLIENT_ID } = require("../config.env");

    const queue = message.client.queue.get(message.guild.id);

I think the problem is that the const comes out of no where and it doesnt know what to do.

Hello and welcome to the freeCodeCamp community~!

The module.exports value should be an object, I believe. You’ve got that syntax, but you’re trying to use const inside an object which does not work.

1 Like

Right, where are the curly braces that surround the code block for that function? They should wrap those const declarations and any other code that is part of that declaration.

2 Likes