Cyanic76 / discord-modmail

THIS IS A MIRROR. ISSUES AND PR MUST BE SUBMITTED TO CODEBERG.
https://codeberg.org/Cyanic76/discord-modmail
MIT License
77 stars 48 forks source link

syntax error #11

Closed anshtyagi0 closed 3 years ago

anshtyagi0 commented 3 years ago

 npm start

discord-modmail@1.0.0 start /home/runner/discord-modmail node bot.js

/home/runner/discord-modmail/bot.js:195 if(message.content.startsWith(${config.prefix}unblock){ ^

SyntaxError: Unexpected token '{' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! discord-modmail@1.0.0 start: node bot.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the discord-modmail@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2021-03-06T07_21_11_749Z-debug.log  exit status 1

Cyanic76 commented 3 years ago

I have just checked the syntax, values and all, could not reproduce. Could you show me your code from line 189 to line 213?

anshtyagi0 commented 3 years ago

ok

anshtyagi0 commented 3 years ago
    return client.users.cache.get(support.targetID).send(`Your ticket #${actualticket} has been closed! If you wish to open a new ticket, feel free to message me.`)
  }
};

})

client.on("message", async message => { if(message.content.startsWith(${config.prefix}unblock){ if(message.guild.member(message.author).roles.cache.has(config.roles.mod)){ var args = message.content.split(" ").slice(1); client.users.fetch(${args[0]}).then(user => { let data = await table.get(isBlocked${args[0]}); if(data === true){ await table.delete(isBlocked${args[0]}); return message.channel.send(Successfully unblocked ${user.username} (${user.id}) from the modmail service.); } else { return message.channel.send(${user.username} (${user.id}) is not blocked from the modmail at the moment.) } }).catch(err => { if(err) return message.channel.send("Unknown user."); }) } else { return message.channel.send("You can not use that."); } } })

anshtyagi0 commented 3 years ago
tell bro
Cyanic76 commented 3 years ago

This looks like a syntax issue on your side. Could you remove those lines and copy again?

anshtyagi0 commented 3 years ago

i have did it bro but same error please check your repo

Cyanic76 commented 3 years ago

What IDE do you use?

anshtyagi0 commented 3 years ago

what that means

Cyanic76 commented 3 years ago

IDE means the interface or app you use to code your bot, like VS Code, Sublime text - This bug is fixed