Discord.js: bot.addFriend is not a function

Created on 19 Sep 2017  Â·  7Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
If I try to send a user a friend request with a user account, an error is thrown:

TypeError: bot.addFriend is not a function
    at Client.bot.on (C:\Users\nah\Documents\Folders\Atomic\spambot.js:37:10)
    at emitNone (events.js:110:20)
    at Client.emit (events.js:207:7)
    at WebSocketConnection.triggerReady (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\WebSocketConnection.js:105:17)
    at WebSocketConnection.checkIfReady (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\WebSocketConnection.js:121:61)
    at ReadyHandler.handle (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\packets\handlers\Ready.js:73:8)
    at WebSocketPacketManager.handle (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
    at WebSocketConnection.onPacket (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\WebSocketConnection.js:290:35)
    at WebSocketConnection.onMessage (C:\Users\nah\Documents\Folders\Atomic\discord.js\src\client\websocket\WebSocketConnection.js:252:22)
    at WebSocket.onMessage (C:\Users\nah\Documents\Folders\Atomic\discord.js\node_modules\ws\lib\EventTarget.js:101:16)

Include a reproducible code sample here, if possible:

bot.addFriend('220604351171919872').then(u => {
                        u.createDM().then(chnl => {
                            chnl.send("A message will go here.")
                        });
                    })

Further details:

  • discord.js version: v12.0.0dev
  • node.js version: v8.3.0
  • Operating system: Windows 10
  • Priority this issue should have – please be realistic and elaborate if possible:

  • [x] I found this issue while running code on a __user account__
  • [x] I have also tested the issue on latest master, commit hash:
invalid

Most helpful comment

Adding friends is a forbidden endpoint so it makes sense that this is not supported.
Forbidden endpoints can result in 1) un-verification or 2) termination of your account.

All 7 comments

As noted in the issue template, please direct all questions regarding usage of the library to the official Discord.js server at https://discord.gg/bRCvFy9

This is an issue regarding usage of the library, not a question. The latest indev and master version doesn't seem to have these functions that are for user accounts only.

The docs do not indicate those methods exist at all on latest master.

Wasn't this the method that unverified user accounts?

Reread the docs.

Adding friends is a forbidden endpoint so it makes sense that this is not supported.
Forbidden endpoints can result in 1) un-verification or 2) termination of your account.

aterzey

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lombra picture Lombra  Â·  3Comments

LLamaFTL picture LLamaFTL  Â·  3Comments

Blumlaut picture Blumlaut  Â·  3Comments

iCrawl picture iCrawl  Â·  3Comments

Dmitry221060 picture Dmitry221060  Â·  3Comments