Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. ERROR
  2. (node:9308) UnhandledPromiseRejectionWarning: TypeError: Supplied parameter was neither a Role nor a Snowflake.
  3. at GuildMember.addRole (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\discord.js\src\structures\GuildMember.js:440:38)
  4. at Client.bot.on (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\index.js:56:16)
  5. at emitOne (events.js:116:13)
  6. at Client.emit (events.js:211:7)
  7. at MessageCreateHandler.handle (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
  8. at WebSocketPacketManager.handle (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
  9. at WebSocketConnection.onPacket (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
  10. at WebSocketConnection.onMessage (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
  11. at WebSocket.onMessage (C:\Users\annma\Desktop\Projects\Bots\Discord\TT\node_modules\ws\lib\event-target.js:120:16)
  12. at emitOne (events.js:116:13)
  13. (node:9308) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
  14. (node:9308) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  15.  
  16. CODE
  17. if(cmd === `${prefix}addRole`){
  18. let userToModify = message.mentions.members.first();
  19. let roleToAdd = message.mentions.roles.first();
  20. return userToModify.addRole(roleToAdd);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement