Sending private messages to user

后端 未结 8 1538
清歌不尽
清歌不尽 2020-12-14 18:39

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 thr

8条回答
  •  盖世英雄少女心
    2020-12-14 19:10

    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.

提交回复
热议问题