英文:
discord message get date time
问题
这是我的代码:
else {
String words = objMsg.getContentRaw().substring(5);
Message msg = event.getMessage();
Member target = msg.getMember();
assert target != null;
objMsgCh.sendMessage("__***警告:***__\n**日期:** " + msg.getTimeCreated()).queue();
objMsgCh.sendMessage("**消息:** " + words + "\n**被警告者:** " + target.getUser().getAsTag()).queue();
}
英文:
How can I get discord's message send time, because when I use msg.getTimeCreated())
, it gets the time but with 4 hours early, what I need to use to be the same as the message time sended?
Here is my code :
else {
String words = objMsg.getContentRaw().substring(5);
Message msg = event.getMessage();
Member target = msg.getMember();
assert target != null;
objMsgCh.sendMessage("__***WARN :***__\n**DATE:** " + msg.getTimeCreated()).queue();
objMsgCh.sendMessage("**Message:** " + words + "\n**Warned from:** " + target.getUser().getAsTag()).queue();
}
答案1
得分: 0
Sure, here's the translation:
好的,在您的代码中使用这个:
var embed = new Discord.MessageEmbed()
.setTimestamp()
英文:
ok use this in ur code
var embed = new Discord.MessageEmbed()
.setTimestamp()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论