[英]How do I "scanf()" and "printf()" a user's message in discord.js when creating a BOT for Discord server?
I am new at coding and I only have the basic knowledge of C
but I do know how other codes work if I know the functions its equivalent in C. I am using discord.js
(12.0.2) to make my Discord bot.我是新的编码和我只有基础知识
C
但我知道如何代码的其他工作,如果我知道它相当于C.我的功能使用AM discord.js
(12.0.2),使我的不和谐机器人。 How do I scan and print a user's sent message?如何扫描和打印用户发送的消息?
To 'scan' a user's message, use the content
property of their message.要“扫描”用户的消息,请使用其消息的
content
属性。 I barely know C but I'm pretty sure the equivalent of printf
is console.log
:我几乎不知道 C 但我很确定
printf
的等价物是console.log
:
const {Client} = require('discord.js')
const client = new Client()
client.on('message', message => {
console.log(message.content)
}
client.login(yourToken)
I recommend reading the Discord.js guide .我建议阅读Discord.js 指南。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.