Jump to content
McKay Development

Error: Access Denied with sendFriendMessage method


Siple

Recommended Posts

Hello, so I wanted to use the sendFriendMessage method to send a message to myself being a friend of the bot. I.e: a random user types a command and a message to submit a help request (ex !help <msg>), "Message sent by random user" is then sent using the sendFriendMessage to me friend of the bot but when I try that it logs Error: AccessDenied. Here is my code:  

let ownerID = my_main_account_id;

//bot sends a message to owner to notify that a new help case was sent
client.chat.sendFriendMessage(ownerID, `New help message received from <b>${username}<b>.`, (response, msg) => {
   console.log(response, msg);//response -> error AccessDenied and no msg
});

 

Edited by Siple
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...