Private Message

๐ ALL INFORMATION CLICK HERE ๐๐ป๐๐ป๐๐ป
Private Message
Sign up with email
Sign up
Sign up with Google
Sign up with GitHub
Sign up with Facebook
5,755 4 4 gold badges 21 21 silver badges 39 39 bronze badges
455 1 1 gold badge 6 6 silver badges 19 19 bronze badges
I do not work with discord.js yet. Can you create an User-Object? If so, you can use UserObject.sendMessage("string");
โย R. Pรผlsinger
Jan 19 '17 at 15:15
The bot is a client, here is the doc page: discord.js.org/#/docs/main/stable/class/Client . Your code won't work because sendMessage isn't a method of the client. I am going to see if I can create a user object.
โย adapap
Jan 19 '17 at 15:41
Have you tried message.author.sendMessage("XXX") ? I use this in the version 10.0.1 of the lib.
โย JulCh
Jan 19 '17 at 16:17
@JulCh I would choose you as the answer. Thanks a ton, I got it working! One more thing if you have the time, how do I check if the (user, not bot) message was sent in a direct message?
โย adapap
Jan 19 '17 at 20:16
@adapap You can check if the message.channel object is an instance of DMChannel (Direct message channel), or a TextChannel for a classic channel :)
โย JulCh
Jan 19 '17 at 23:12
10.1k 4 4 gold badges 46 46 silver badges 53 53 bronze badges
3,205 2 2 gold badges 16 16 silver badges 23 23 bronze badges
Remember that the discord.js documentation ( discord.js.org/#/docs/main/stable/general/welcome ) is written as a javadoc and may not always be effective for usage examples or translating intention into code. It is unwise to suggest someone study the entire library for a specific implementation when such sites as StackOverflow exist for that. It is best to point them to documentation relative to their question instead ( discord.js.org/#/docs/main/stable/search?q=sendmessage ).
โย Abandoned Cart
Apr 2 '17 at 16:09
.sendMessage('content') is now deprecated - instead, use .send('content')
โย Blundering Philosopher
Mar 1 '18 at 22:16
91 1 1 silver badge 11 11 bronze badges
Indeed, sendMessage() is deprecated.
โย Pritt Balagopal
Sep 6 '18 at 8:03
6,425 4 4 gold badges 7 7 silver badges 38 38 bronze badges
701 7 7 silver badges 12 12 bronze badges
.fetchUser() is no longer a valid function...
โย ATR
Jan 24 at 18:01
6,425 4 4 gold badges 7 7 silver badges 38 38 bronze badges
6,425 4 4 gold badges 7 7 silver badges 38 38 bronze badges
syntax error.. should be if (msg.content === 'trigger') msg.author.send('text') . one ( and } too much
โย Fipsi
Jul 11 '19 at 9:43
Highly active question . Earn 10 reputation in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.
Agile Software Development, Cloud Services, Information Technology
Computer Software, Electronic Time Tracking, SaaS
Stack Overflow
Questions
Jobs
Developer Jobs Directory
Salary Calculator
Help
Mobile
Disable Responsiveness
Products
Teams
Talent
Advertising
Enterprise
Company
About
Press
Work Here
Legal
Privacy Policy
Terms of Service
Contact Us
Stack Exchange Network
Technology
Life / Arts
Culture / Recreation
Science
Other
Join Stack Overflow to learn, share knowledge, and build your career.
I'm using the discord.js library and node.js to create a Discord bot that facilitates poker. It is functional except the hands are shown to everyone, and I need to loop through the players and send them a DM with their hand.
This is the code that sends a message to the channel when any user sends a message. I need the bot to reply in a private channel; I've seen dmChannel , but I do not understand how to use it. I have the username of the member that I want to send a message to.
An example would be appreciated.
Edit:
After looking around for a user object, I found that I can get all of the users using the .users property of the client (bot). I will try using the user.sendMessage("string") method soon.
In order for a bot to send a message, you need .send() , the client is where the bot will send a message to(A channel, everywhere in the server, or a PM). Since you want the bot to PM a certain user, you can use message.author as your client . (you can replace author as mentioned user in a message or something, etc)
Hence, the answer is: message.author.send("Your message here.")
I recommend looking up the Discord.js documentation about a certain object's properties whenever you get stuck, you might find a particular function that may serve as your solution.
The above answers work fine too, but I've found you can usually just use message.author.send("blah blah") instead of message.author.sendMessage("blah blah") .
-EDIT- : This is because the sendMessage command is outdated as of v12 in Discord Js
.send tends to work better for me in general than .sendMessage, which sometimes runs into problems.
Hope that helps a teeny bit!
To send a message to a user you first need a User instance representing the user you want to send the message to.
Once you got a user instance you can send the message with .send
If your looking to type up the message and then your bot will send it to the user, here is the code. It also has a role restriction on it :)
If you want to send the message to a predetermined person, such as yourself, you can set it so that the channel it would be messaging to would be their (your) own userID. So for instance, if you're using the discord bot tutorials from Digital Trends, where it says "to: ", you would continue with their (or your) userID. For instance, with how that specific code is set up, you could do "to: userID", and it would message that person. Or, if you want the bot to message you any time someone uses a specific command, you could do "to: '12345678890'", the numbers being a filler for the actual userID. Hope this helps!
This is pretty simple here is an example
Make the code say if (msg.content === ('trigger') msg.author.send('text')}
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo ยฉ 2021 Stack Exchange Inc; user contributions licensed under cc by-sa . revย 2021.2.2.38474
Private Message | Drupal.org
javascript - Sending private messages to user - Stack Overflow
GitHub - jez500/ Private - Message -Messenger: A Facebook messenger style UX...
private message - ััะพ... ะงัะพ ัะฐะบะพะต private message ?
How do I send a private message to a Facebook Page? | Facebook Help Center
jez500
/
Private-Message-Messenger
ยฉ 2021 GitHub, Inc.
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About
Private messages in Drupal 8, that look like sweet!
This is "Facebook messenger" style UX for the Private Message module .
The whole UX is build using Backbone & Marionette, making it a snappy single page app. View messages, chnage threads,
compose and reply to messages without a single page reload.
It is build with mobile in mind and will switch between mobile/desktop layout as space provides.
The Private Message module provides the framework for this module
to work. It does a great job of handling message and thread structure using entites.
This module utilizes MarionetteJS to improve on BackboneJS capabilities. As of writing, it is not on drupal.org yet.
Grab it from: https://github.com/jez500/Drupal8-Marionette-JS
This module was built using Marionette v3.5.1 , download the zip from https://marionettejs.com/download/ and extract
into your /libraries folder.
The selectize JS library is used for adding new recipients to messages, install the
Selectize drupal module and download the
library to your /libraries folder.
Composer only instructions until I work out what to do with this module.
Then...
composer require drupal/marionettejs
And...
composer require drupal/private_message_messenger
Download and extract the following to the /libraries folder
drush en -y private_message_messenger
See Private Message NodeJS which was specifically made to
compliment this module.
To make the dates on threads and messages look a lot nicer and use a live XX mins ago style format, you can include
the timeago library library. To include this from a CDN, visit the settings page and tick the
Include timeago.js from remote CDN checkbox. To include it locally, you will need to add the library to your
theme or module manually .
If the timeago() function is detected, this module will use it.
This module is created by Jeremy Graham
but wouldn't be possible without all the great work done by Jaypan
on the Private Message module
A Facebook messenger style UX for the Drupal 8 "Private Message" module
Ass 8
Xhamster Hairy Ass
Tranny Com Xhamster
Toddler Vagina Pee
Bbw Hard Sex






































