Rewrite createdate and joindate gets
Update botinfo to work with new getCreationDate Update userinfo to work with new getCreationDate Update userinfo to work with new getJoinDate
This commit is contained in:
parent
0d5502bc92
commit
49e6eaed11
6 changed files with 19 additions and 44 deletions
|
@ -1,34 +0,0 @@
|
|||
module.exports = function (user) {
|
||||
let creationMonth, creationDate, creationHours, creationMinutes, creationSeconds;
|
||||
|
||||
if (user.createdAt.getUTCMonth().toString().length === 1)
|
||||
creationMonth = "0" + (1+user.createdAt.getUTCMonth())
|
||||
else
|
||||
creationMonth = (1+user.createdAt.getUTCMonth())
|
||||
|
||||
if (user.createdAt.getUTCDate().toString().length === 1)
|
||||
creationDate = "0" + user.createdAt.getUTCDate()
|
||||
else
|
||||
creationDate = user.createdAt.getUTCDate()
|
||||
|
||||
if (user.createdAt.getUTCHours().toString().length === 1)
|
||||
creationHours = "0" + user.createdAt.getUTCHours()
|
||||
else
|
||||
creationHours = user.createdAt.getUTCHours()
|
||||
|
||||
|
||||
if (user.createdAt.getUTCMinutes().toString().length === 1)
|
||||
creationMinutes = "0" + user.createdAt.getUTCMinutes()
|
||||
else
|
||||
creationMinutes = user.createdAt.getUTCMinutes()
|
||||
|
||||
|
||||
if (user.createdAt.getUTCSeconds().toString().length === 1)
|
||||
creationSeconds = "0" + user.createdAt.getUTCSeconds()
|
||||
else
|
||||
creationSeconds = user.createdAt.getUTCSeconds()
|
||||
|
||||
|
||||
let creation = `${user.createdAt.getUTCFullYear()}-${creationMonth}-${creationDate} ${creationHours}:${creationMinutes}:${creationSeconds}`
|
||||
return { creation: creation }
|
||||
}
|
4
util/getCreationDate.js
Normal file
4
util/getCreationDate.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
module.exports = function(user){
|
||||
let date = user.createdAt;
|
||||
return date.getUTCFullYear().toString()+"-"+date.getUTCMonth()+"-"+date.getUTCDate()+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds();
|
||||
}
|
5
util/getJoinDate.js
Normal file
5
util/getJoinDate.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
module.exports = function(user, guild){
|
||||
const member = guild.member(user)
|
||||
let date = member.joinedAt;
|
||||
return date.getUTCFullYear().toString()+"-"+date.getUTCMonth()+"-"+date.getUTCDate()+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue