Created
February 16, 2018 03:48
-
-
Save eritbh/ac1841b0ea591bbcb9a0e8e6c9c221fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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