fork download
  1. const Discord = require('discord.js');
  2. const { prefix, token } = require('./config.json');
  3. const client = new Discord.Client();
  4.  
  5. client.once('ready', () => {
  6. console.log('Ready!');
  7. });
  8.  
  9. client.on('guildMemberAdd', member => {
  10. console.log(member.user.username);
  11. console.log(member.user.discriminator);
  12. //client.on('message',
  13. //member.send(`Join using this link: ${message.author.username}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${message.author.username}%23${message.author.discriminator}#join`);
  14. member.send(`Join using this link: ${member.user.tag}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${member.user.username}%23${member.user.discriminator}#join`);
  15. });
  16.  
  17.  
  18. client.on('message', message => {
  19. if (message.content.startsWith(`${prefix}ping`)) {
  20. // send back "Pong." to the channel the message was sent in
  21. message.channel.send('Pong.');
  22. }else if (message.content === `${prefix}join`) {
  23. message.channel.send(`Hey, <@${message.author.id}>! I have sent you a private message with the link that you should use to have full access to The Society!`);
  24. message.author.send(`Join using this link: ${message.author.username}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${message.author.username}%23${message.author.discriminator}#join`);
  25. }
  26. });
  27.  
  28. client.login(token);
Runtime error #stdin #stdout #stderr 0.29s 35680KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: "prog.js", line 14: illegal character: `
js:     member.send(`Join using this link: ${member.user.tag}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${member.user.username}%23${member.user.discriminator}#join`);
js: ................^
js: "prog.js", line 14: missing ) after argument list
js:     member.send(`Join using this link: ${member.user.tag}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${member.user.username}%23${member.user.discriminator}#join`);
js: .....................^
js: "prog.js", line 14: illegal character: \
js:     member.send(`Join using this link: ${member.user.tag}\nLink: https://w...content-available-to-author-only...s.com/society?discordid=${member.user.username}%23${member.user.discriminator}#join`);
js: ..........................................................^
js: "prog.js", line 15: syntax error
js: });
js: ^
js: "prog.js", line 19: illegal character: `
js: 	if (message.content.startsWith(`${prefix}ping`)) {
js: ................................^
js: "prog.js", line 19: missing ) after argument list
js: 	if (message.content.startsWith(`${prefix}ping`)) {
js: ..................................^
js: "prog.js", line 19: illegal character: `
js: 	if (message.content.startsWith(`${prefix}ping`)) {
js: ..............................................^
js: "prog.js", line 19: syntax error
js: 	if (message.content.startsWith(`${prefix}ping`)) {
js: ...............................................^
js: "prog.js", line 21: syntax error
js:         message.channel.send('Pong.');
js: ................^
js: "prog.js", line 22: missing ) after argument list
js:     }else if (message.content === `${prefix}join`) {
js: .........^
js: "prog.js", line 22: illegal character: `
js:     }else if (message.content === `${prefix}join`) {
js: ..................................^
js: "prog.js", line 22: missing ; before statement
js:     }else if (message.content === `${prefix}join`) {
js: ....................................^
js: "prog.js", line 22: illegal character: `
js:     }else if (message.content === `${prefix}join`) {
js: ................................................^
js: "prog.js", line 22: syntax error
js:     }else if (message.content === `${prefix}join`) {
js: .................................................^
js: "prog.js", line 23: syntax error
js:         message.channel.send(`Hey, <@${message.author.id}>! I have sent you a private message with the link that you should use to have full access to The Society!`);
js: ................^
js: "prog.js", line 23: illegal character: `
js:         message.channel.send(`Hey, <@${message.author.id}>! I have sent you a private message with the link that you should use to have full access to The Society!`);
js: .............................^
js: "prog.js", line 28: illegally formed XML syntax
js: client.login(token);
js: ...................^
js: "prog.js", line 28: syntax error
js: client.login(token);
js: ...................^
js: "prog.js", line 28: missing } after function body
js: client.login(token);
js: ...................^
js: "prog.js", line 1: Compilation produced 19 syntax errors.