Skip to content

Instantly share code, notes, and snippets.

@eritbh
Created February 16, 2018 03:48
Show Gist options
  • Select an option

  • Save eritbh/ac1841b0ea591bbcb9a0e8e6c9c221fa to your computer and use it in GitHub Desktop.

Select an option

Save eritbh/ac1841b0ea591bbcb9a0e8e6c9c221fa to your computer and use it in GitHub Desktop.
const eris = require('eris')
const bot = new eris('token')
bot.on('guildMemberAdd', (member, guild) => {
bot.getDMChannel(member.id).then(channel => {
console.log(channel.id)
}).catch(e => {
console.log('Get channel fail\n' + e)
})
})
bot.connect()
$ node index.js
Get channel fail
DiscordRESTError [20001]: DiscordRESTError [20001]: Bots cannot use this endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment